Quantcast

Re: Re: AWT Image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: AWT Image

Marcio Ghiraldelli
    Thanks, that was handfull.



----- Original Message -----
From: "Tim Boudreau" <[hidden email]>
To: <[hidden email]>
Sent: Monday, July 25, 2005 5:08 AM
Subject: [nbusers] Re: AWT Image


> Tim Boudreau wrote:
>> Marcio Ghiraldelli wrote:
>>
>>>     I am developing for WindowsCE (InsigniaEVM 1.2) with NetBeans 4.1
>>>  Simple newbie question:
>>>         How do I insert an image in an AWT Frame via the GUI builder?
>>
>>
>> AFAIK there isn't any handy component for showing images (there really
>> should be - am I forgetting about something?), but it's trivial to write
>
> I'm sort of forgetting about something.  Blazingly non-obvious to a newbie
> (and apparently to an old-timer until I think about it):
>
> new JLabel (new ImageIcon (MyClass.class.getResource("some_jpeg.jpg")))
>
> (where some_jpeg.jpg is in the same directory as your class file).  I feel
> your pain - there's pretty much no way to figure out from the docs of
> java.awt.Image or its subclasses, how to either get an instance of an
> image or paint one on screen - it's a pretty stunning example of how to
> write reference documentation so that it will be absolutely correct and
> completely useless at the same time.
>
> -Tim
>
>
>


Loading...