Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28
  1. #21
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,036
    Rep Power
    6

    Default Re: iamge icon where to put it

    Okay. Glad it works. Don't worry about optimizing. Quite often a working program breaks because someone thought to optimize it.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  2. #22
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    9

    Default Re: iamge icon where to put it

    I still have my issue with the JButton JCheckBox icon which wont show up.
    Here is what's going on:
    pf = new JCheckBox("piano room"); -> shows checkbox with text
    pf = new JCheckBox("piano room", icon2); -> shows only the text WITHOUT THE CHECK BOX (why?)

    at the constructor I say:
    icon1 = new ImageIcon("images/keyboard.gif");
    icon2 = new ImageIcon("images/right.gif");

    The images are in the folder NetBeansProjects/roomassigment/rsc/roomassigment/images

    please tell me what is going on here (very confusing)

  3. #23
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,036
    Rep Power
    6

    Default Re: iamge icon where to put it

    You could always convert to a HashMap. Then you could use the room number as a key into the map to get the appropriate object.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  4. #24
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    9

    Default Re: iamge icon where to put it

    But what is the reason for not showing, jim?

  5. #25
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,036
    Rep Power
    6

    Default Re: iamge icon where to put it

    I am having a hard time following this. Please post your current code with all recent changes. Also include what problem you are trying to solve.

    Thanks,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #26
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    9

    Default Re: iamge icon where to put it

    Got it, thanks anyway!

  7. #27
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: iamge icon where to put it

    Quote Originally Posted by willemjav View Post
    But what is the reason for not showing, jim?
    Read my Toggle Button Icons Java Tips Weblog and you'll know why.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  8. #28
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    9

    Default Re: iamge icon where to put it

    I will, great, thanks db
    (for now I only have the textstring of the checkbox and the icon in a label so:
    checkbox and string and label icon next....
    so let see what you say bout this!

Page 2 of 2 FirstFirst 12

Similar Threads

  1. icon does not change when I want it too
    By drewtrcy in forum New To Java
    Replies: 1
    Last Post: 05-05-2011, 06:10 PM
  2. Adding another icon to an icon
    By whateverme in forum New To Java
    Replies: 11
    Last Post: 03-29-2011, 09:00 PM
  3. how to set application icon??
    By chyeeqi in forum New To Java
    Replies: 2
    Last Post: 03-31-2010, 04:43 AM
  4. set.Icon
    By safiya in forum NetBeans
    Replies: 2
    Last Post: 10-17-2008, 07:46 PM
  5. icon
    By amith in forum AWT / Swing
    Replies: 1
    Last Post: 05-16-2008, 08:34 PM

Tags for this Thread

Posting Permissions

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