java - How Do I Set An Icon For JLabel -


I want to set an icon for a JLLL, someone can give me the syntax example

I have tried this:

  jlab icon = new jlab (); Image Icon chromo = createImageIcon ("res / icon.png"); Panel.add (icon); Icon.setIcon (sun); After that, I tried that the label was not visible at all on the panel.   

  jlab icon = new jlab (); Image Icon chromo = createImageIcon ("res / icon.png"); Icon.setIcon (sun); Panel.add (icon);  

And do not forget to check your layout .... if its full you need to add boundaries

  icon.setBounds (startX, StartY, width, height);  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -