Im trying to get the defaultIcon from getComponentAt()
mediaPanel.getComponentAt(arg0.getX(), arg0.getY())
And i get the putput:
javax.swing.JLabel[,2,0,151x228,alignmentX=0.0,alignmentY=0.0,border=,flags=8388608,maximumSize=,minimumSize=,preferredSize=,defaultIcon=https://dl.dropboxusercontent.com/u/16670644/Projekt/TempPic.png,disabledIcon=,horizontalAlignment=CENTER,horizontalTextPosition=TRAILING,iconTextGap=4,labelFor=,text=,verticalAlignment=CENTER,verticalTextPosition=CENTER]
Now i'm trying to catch the defaultIcon as a string via:
But i cant convert a component to a string, i tried parse it but without luck.String returnString = mediaPanel.getComponentAt(arg0.getX(), arg0.getY()); String tempString = returnString.substring(indexOf("defaultIcon")+12); String defaultIcon = tempString.substring(0,indexOf(","));