Re: Displaying Images
- From: "Andrew Thompson" <andrewthommo@xxxxxxxxx>
- Date: 18 Feb 2007 18:01:16 -0800
On Feb 19, 12:13 pm, "Sean C." <BrknSh...@xxxxxxxxx> wrote:
....
(images)
...I've tried loading them using a
path-like string, but that doesn't work. I've tried loading them using
getResource() and that doesn't seem to work as well.
I see there being two basic parts to this
problem.
1) getting the path to the images
2) loading and displaying them
If part 1) does not work, part 2)
is moot.
So, I suggest you write up some test code
that focuses on getting a valid URL to
the image (or one of them).
If you cannot get that working, post
your short code (that focuses only on
finding the image) to the group and we
might be able to assist further.
For part 2), there are a number of ways
you might go about loading and displaying
the image, but one way is this..
JLabel imageLabel = new JLabel(
new ImageIcon( theImageURL ) );
parent.add( imageLabel );
Andrew T.
.
- References:
- Displaying Images
- From: Sean C.
- Displaying Images
- Prev by Date: Displaying Images
- Next by Date: Re: Displaying Images
- Previous by thread: Displaying Images
- Next by thread: Re: Displaying Images
- Index(es):
Relevant Pages
|