Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > gif in JFrame

Reply
Thread Tools

gif in JFrame

 
 
focode
Guest
Posts: n/a
 
      09-18-2008
i want to introduce a gif image file into my Jframe . how can i achive
this , also if it is possible through netbeans then tell me that also

thanks
 
Reply With Quote
 
 
 
 
Stefan Rybacki
Guest
Posts: n/a
 
      09-18-2008
focode schrieb:
> i want to introduce a gif image file into my Jframe . how can i achive
> this , also if it is possible through netbeans then tell me that also
>


JFrame frame=new JFrame();
frame.add(new JLabel("image.gif"));
frame.setSize(100,100);
frame.setVisible(true);

There you introduce a gif image file represented by name into your JFrame.

Is this not what you meant? I've guessed so, make your self clearer next time.


Stefan
> thanks

 
Reply With Quote
 
 
 
 
softwarepearls_com
Guest
Posts: n/a
 
      09-18-2008
On Sep 18, 1:06*pm, Stefan Rybacki <(E-Mail Removed)> wrote:
> focode schrieb:
>
> > i want to introduce a gif image file into my Jframe . how can i achive
> > this , also if it is possible through netbeans then tell me that also

>
> JFrame frame=new JFrame();
> frame.add(new JLabel("image.gif"));
> frame.setSize(100,100);
> frame.setVisible(true);
>
> There you introduce a gif image file represented by name into your JFrame..
>
> Is this not what you meant? I've guessed so, make your self clearer next time.
>
> Stefan
>
> > thanks

>
>


I think you forgot the "new ImageIcon" bit
 
Reply With Quote
 
Stefan Rybacki
Guest
Posts: n/a
 
      09-18-2008
softwarepearls_com schrieb:
> On Sep 18, 1:06 pm, Stefan Rybacki <(E-Mail Removed)> wrote:
>> focode schrieb:
>>
>>> i want to introduce a gif image file into my Jframe . how can i achive
>>> this , also if it is possible through netbeans then tell me that also

>> JFrame frame=new JFrame();
>> frame.add(new JLabel("image.gif"));
>> frame.setSize(100,100);
>> frame.setVisible(true);
>>
>> There you introduce a gif image file represented by name into your JFrame.
>>
>> Is this not what you meant? I've guessed so, make your self clearer next time.
>>
>> Stefan
>>
>>> thanks

>>

>
> I think you forgot the "new ImageIcon" bit


Not really, I just introduced the image file as the OP wanted. Not the image in
that file. I just wanted to point out, that his explanation of what he's trying
to achieve is insufficent.

Stefan
 
Reply With Quote
 
Daniel Pitts
Guest
Posts: n/a
 
      09-19-2008
focode wrote:
> i want to introduce a gif image file into my Jframe . how can i achive
> this , also if it is possible through netbeans then tell me that also
>
> thanks

frame.add(new JLabel(new ImageIcon("myImage.gif")));

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
 
Reply With Quote
 
Daniel Pitts
Guest
Posts: n/a
 
      09-19-2008
Stefan Rybacki wrote:
> softwarepearls_com schrieb:
>> On Sep 18, 1:06 pm, Stefan Rybacki <(E-Mail Removed)> wrote:
>>> focode schrieb:
>>>
>>>> i want to introduce a gif image file into my Jframe . how can i achive
>>>> this , also if it is possible through netbeans then tell me that also
>>> JFrame frame=new JFrame();
>>> frame.add(new JLabel("image.gif"));
>>> frame.setSize(100,100);
>>> frame.setVisible(true);
>>>
>>> There you introduce a gif image file represented by name into your
>>> JFrame.
>>>
>>> Is this not what you meant? I've guessed so, make your self clearer
>>> next time.
>>>
>>> Stefan
>>>
>>>> thanks
>>>

>>
>> I think you forgot the "new ImageIcon" bit

>
> Not really, I just introduced the image file as the OP wanted. Not the
> image in that file. I just wanted to point out, that his explanation of
> what he's trying to achieve is insufficent.


Human communication is often insufficient, however humans also generally
have the ability to extract the proper meaning out of insufficient
communications. They call it inference.

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-19-2008
On Thu, 18 Sep 2008 03:12:51 -0700 (PDT), focode
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone
who said :

>i want to introduce a gif image file into my Jframe . how can i achive
>this , also if it is possible through netbeans then tell me that also


I wrote a Components called ImageViewer and ResizingImageViewer. See
http://mindprod.com/products1.html#COMMON11
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Get One JFrame To Appear Above Another JFrame clusardi2k@aol.com Java 2 08-27-2012 03:01 PM
Animated GIF display in JFrame vs. JApplet Qu0ll Java 17 06-29-2008 07:03 AM
start a new JFrame from an existing one, and when old JFrame closes new one does not jakester Java 3 04-02-2007 11:13 PM
gif into JFrame palmis Java 2 01-18-2006 08:34 AM
How to convert a base 64 encoded GIF image to a *.gif file? hb ASP .Net 6 09-28-2004 08:24 PM



Advertisments