gif in JFrame

Discussion in 'Java' started by focode, Sep 18, 2008.

  1. focode

    focode Guest

    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
    focode, Sep 18, 2008
    #1
    1. Advertising

  2. 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
    Stefan Rybacki, Sep 18, 2008
    #2
    1. Advertising

  3. On Sep 18, 1:06 pm, Stefan Rybacki <> 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
    softwarepearls_com, Sep 18, 2008
    #3
  4. softwarepearls_com schrieb:
    > On Sep 18, 1:06 pm, Stefan Rybacki <> 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
    Stefan Rybacki, Sep 18, 2008
    #4
  5. focode

    Daniel Pitts Guest

    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/>
    Daniel Pitts, Sep 19, 2008
    #5
  6. focode

    Daniel Pitts Guest

    Stefan Rybacki wrote:
    > softwarepearls_com schrieb:
    >> On Sep 18, 1:06 pm, Stefan Rybacki <> 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/>
    Daniel Pitts, Sep 19, 2008
    #6
  7. focode

    Roedy Green Guest

    On Thu, 18 Sep 2008 03:12:51 -0700 (PDT), focode
    <> 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
    Roedy Green, Sep 19, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hb
    Replies:
    6
    Views:
    9,103
  2. palmis

    gif into JFrame

    palmis, Jan 17, 2006, in forum: Java
    Replies:
    2
    Views:
    436
    palmis
    Jan 18, 2006
  3. jakester
    Replies:
    3
    Views:
    1,802
    jakester
    Apr 3, 2007
  4. Qu0ll
    Replies:
    17
    Views:
    2,069
    Andrew Thompson
    Jun 29, 2008
  5. Replies:
    2
    Views:
    400
    markspace
    Aug 27, 2012
Loading...

Share This Page