Results 1 to 3 of 3

Thread: set.Icon

  1. #1
    safiya is offline Member
    Join Date
    Oct 2008
    Posts
    2
    Rep Power
    0

    Default set.Icon

    plx can sum1 tell me how to use dis function.i want to use it like
    String ans = txt1.getText();
    if (ans.equalsIgnoreCase("AE"))
    {
    label.setIcon(icon);
    }
    i dont knw wer to save da picture i wnt to put in and wat to ryt in da brackets:confused:

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,412
    Rep Power
    25

    Default

    Sorry, I can't understand your english. Could you try to explain your problem again?

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Do you want to add an icon on a label? Better to explain it much clearly.

    If you want to set an icon on a label, JLabel better to use an ImageIcon. There is a overloaded constructor to add an icon/image in JLabel. Read the Java doc, you can find lots of details there.

Similar Threads

  1. Applet Icon
    By arimakidd in forum Java Applets
    Replies: 4
    Last Post: 04-30-2009, 04:05 AM
  2. Yes No Icon MessageBox in SWT
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 07:57 PM
  3. Example of an icon that changes form
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 11:18 PM
  4. icon
    By amith in forum AWT / Swing
    Replies: 1
    Last Post: 05-16-2008, 07:34 PM
  5. How to set an Icon in a Label?
    By Soda in forum New To Java
    Replies: 2
    Last Post: 12-07-2007, 12:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •