Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Help with inserting an image in a jframe

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Help with inserting an image in a jframe

    Hello i am a biginner in java
    And i want to insert an image in a jframe please give me an answer today thanks every body


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,465
    My Mood
    Mellow
    Thanks
    149
    Thanked 607 Times in 594 Posts

    Default re: Help with inserting an image in a jframe

    Welcome to the Forum! Please read this topic to learn how to post your code correctly along with other useful info for newcomers.

    Please give your threads useful titles. I'll retitle this one to be more descriptive. It's also important to show what you've tried when you ask for help. We can't give you code or help you fix your code if there is none to help with or fix.

  3. #3
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: Help with inserting an image in a jframe

    Quote Originally Posted by Imi View Post
    i want to insert an image in a jframe please give me an answer today thanks every body
    There are many ways to have an image into (said in general) a window. It depends on if you want to draw yourself the image (=custom painting) or if you want to take advantage of Swing features (e.g. using an ImageIcon applied to a JButton or JLabel).
    Without knowing exactly what you want, I can only direct you to the official tutorial:
    http://docs.oracle.com/javase/tutori...ges/index.html
    http://docs.oracle.com/javase/tutori...ents/icon.html
    Andrea, www.andbin.netSCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginnersMy new project Java Examples on Google Code

  4. #4
    Junior Member
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with inserting an image in a jframe

    Quote Originally Posted by GregBrannon View Post
    Welcome to the Forum! Please read this topic to learn how to post your code correctly along with other useful info for newcomers.

    Please give your threads useful titles. I'll retitle this one to be more descriptive. It's also important to show what you've tried when you ask for help. We can't give you code or help you fix your code if there is none to help with or fix.
    Ok thanks i ll try to follow the steps next time

    --- Update ---

    Quote Originally Posted by andbin View Post
    There are many ways to have an image into (said in general) a window. It depends on if you want to draw yourself the image (=custom painting) or if you want to take advantage of Swing features (e.g. using an ImageIcon applied to a JButton or JLabel).
    Without knowing exactly what you want, I can only direct you to the official tutorial:
    Lesson: Working with Images (The Java™ Tutorials > 2D Graphics)
    How to Use Icons (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    Ok i want to use an ImageIcon applied to a JButton or JLabel and thank you

  5. #5
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: Help with inserting an image in a jframe

    Quote Originally Posted by Imi View Post
    Ok i want to use an ImageIcon applied to a JButton or JLabel and thank you
    Ok and what are the doubts now? Did you see the javadoc documentation for ImageIcon and JLabel?
    Andrea, www.andbin.netSCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginnersMy new project Java Examples on Google Code

  6. #6
    Junior Member
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with inserting an image in a jframe

    Quote Originally Posted by andbin View Post
    Ok and what are the doubts now? Did you see the javadoc documentation for ImageIcon and JLabel?
    Thank you and i think that i solved the problem thanks again you really helped me

Similar Threads

  1. Image not diplaying in Jframe. Is there anything wrong in my Code?
    By hnviradiya in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 23rd, 2013, 06:49 AM
  2. Image display problem on JFrame...Whats wrong......need help?????'
    By suyog53 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 12th, 2012, 12:06 PM
  3. Image display problem on JFrame...Can any1 help?????'
    By suyog53 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 21st, 2012, 09:26 AM
  4. Inserting Image Help
    By Bradshjo in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 22nd, 2010, 12:50 PM
  5. Java Gif image problem in JFrame
    By Zachary Wins in forum What's Wrong With My Code?
    Replies: 0
    Last Post: May 23rd, 2010, 08:51 PM