Results 1 to 3 of 3
  1. #1
    EscSequenceAlpha is offline Senior Member
    Join Date
    Apr 2012
    Posts
    115
    Rep Power
    0

    Default How do I make images available for my GUI?

    I was going through some image tutorials with thenewboston and he said I need to put the images in the same directory as my .java files

    I guess so I can use getClass().getResource();

    however after I did this they dont show up at all in the package explorer of eclipse. they are in png format as suggested, apparently he had trouble with other formats

    not only can eclipse not see them but the code that reference them also wont work

    troubleshooting, are there any eclipse menus or things that I can do to import them for my environment?

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default Re: How do I make images available for my GUI?

    Move to Eclipse

    they are in png format as suggested, apparently he had trouble with other formats
    I would be cautious of a tutorial that only works for png, and not other formats that are standard image formats readily read by ImageIO of comparable java tools (jpeg, gif)

    not only can eclipse not see them but the code that reference them also wont work
    Define 'wont work' (and please use proper grammar and capitalization - you are talking to programmers who write code all day long that requires exact syntax)..did you import the image into your project/package?

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: How do I make images available for my GUI?

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

Similar Threads

  1. Replies: 1
    Last Post: 03-03-2012, 09:35 PM
  2. Replies: 4
    Last Post: 07-23-2011, 08:08 PM
  3. Replies: 0
    Last Post: 12-16-2010, 05:14 PM
  4. Replies: 4
    Last Post: 12-16-2010, 04:32 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
  •