Results 1 to 6 of 6
  1. #1
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default Netbeans Image Help

    I am storing an image into a JLabel and then put in a JFrame to display. However, when I run the program the image disappears. This is because the Windows Vista Color Scheme has changed. What should I do in this case?

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

    Default

    How did you added an image to the label. And also how did you added label to the frame, didn't you use any container like JPanel?

  3. #3
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default

    The image is an icon in JLabel. The JLabel is stored in a JFrame. Is anything wrong?

    also, is there any way I can autoadjust an image (in JLabel) to full screen?

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

    Default

    Add the all component in the panel and that panel should be added to the frame. You can set the size (width and height) same as the frame.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Quote Originally Posted by hitmen View Post
    However, when I run the program the image disappears. This is because the Windows Vista Color Scheme has changed.
    How do you know that this in fact is the cause of your problem?

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

    Default

    That's a good point Fubarable. I miss it.

    I don't think that Vista can effect on Swing API anyhow. What I believe is that our thread starter mess up with the components.

Similar Threads

  1. Replies: 14
    Last Post: 04-10-2009, 08:46 AM
  2. NetBeans IDE 6.5 - The only IDE you need
    By Eranga in forum Reviews / Advertising
    Replies: 2
    Last Post: 11-26-2008, 09:37 AM
  3. Canvas Image popups another image (SWT)
    By SpaceY in forum New To Java
    Replies: 2
    Last Post: 11-11-2008, 01:25 PM
  4. drawing an image to an offscreen image
    By hunterbdb in forum Java 2D
    Replies: 9
    Last Post: 10-30-2008, 06:17 PM
  5. Replies: 0
    Last Post: 01-08-2008, 05:29 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
  •