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 7 of 7

Thread: Using BufferedImage with JFrame

  1. #1
    Member Zyrion's Avatar
    Join Date
    Feb 2013
    Location
    Iowa
    Posts
    106
    My Mood
    Angelic
    Thanks
    2
    Thanked 8 Times in 8 Posts

    Default Using BufferedImage with JFrame

    I have an image inside my resource folder used by BlueJ that I want to paint onto the display area of my JFrame object. The issue I am having is copying the image data (i.e. "Grass.jpg") from my resource folder to a BufferedImage object. Then painting that BufferedImage object onto the JFrame.

    In essence: Image from Resource -> BufferedImage Object -> JFrame Paint.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Using BufferedImage with JFrame

    What have you tried? Where is your SSCCE? What exactly is the problem you're encountering?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Using BufferedImage with JFrame

    Suggested reading: Lesson: Working with Images (The Java™ Tutorials > 2D Graphics) ...a link that was one of the top hits for searching the internet 'java images'

  4. #4
    Member Zyrion's Avatar
    Join Date
    Feb 2013
    Location
    Iowa
    Posts
    106
    My Mood
    Angelic
    Thanks
    2
    Thanked 8 Times in 8 Posts

    Default Re: Using BufferedImage with JFrame

    Instead of making assumptions on my ability to research a problem please be more constructive and less defaming. It would be much appreciated. I am currently reading a Java programming book that has solely 150 pages dedicated to Java 2D Graphics (animations, transformations, etc.), and images. So it is established that I am unable to grasp this concept as I have already tried. I don't need you to spoon feed me code, but I thought it would nice and simple enough for a experienced Java programmer to give me tidbits of advice or code to point me in the right direction, instead of throwing links at me. If you are to lazy to help me, do not waste my time or yours by copying and pasting a webpage address.

    Thanks and have a fantastic day.

  5. #5
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Using BufferedImage with JFrame

    Quote Originally Posted by Zyrion View Post
    I thought it would nice and simple enough for a experienced Java programmer to give me tidbits of advice
    Two experienced programmers both give you great advice. This advice is based on how you can help yourself.

    Quote Originally Posted by Zyrion View Post
    The issue I am having is copying the image data (i.e. "Grass.jpg") from my resource folder to a BufferedImage object
    There is an unlimited number of ways to do this, and asking "What have you tried" is an excellent question. What did you try? What problem did you have? What results did you get? We can not see your screen from our house... help us help you by providing the information necessary to give you more than a link if you want more than a link.

  6. The Following 2 Users Say Thank You to jps For This Useful Post:

    copeg (September 12th, 2013), KevinWorkman (September 13th, 2013)

  7. #6
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Using BufferedImage with JFrame

    Often replies to question reflect how the question was phrased. If you wish to ignore (or even take offense to) attempts to help, so be it. But they are what they are, attempts to help. Maybe describe further what problems you are having. What attempts you've made. Where exactly you are stuck

    Instead of making assumptions
    We have nothing other than make assumptions given the information initially provided. You mentioned nothing of what you've tried, what you know, or what your research told you and where you are confused.

    do not waste my time or yours by copying and pasting a webpage address.
    Sure thing. Hopefully someone else will help you along your way.

  8. #7
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Using BufferedImage with JFrame

    I don't need you to spoon feed me code, but I thought it would nice and simple enough for a experienced Java programmer to give me tidbits of advice or code to point me in the right direction, instead of throwing links at me. If you are to lazy to help me, do not waste my time or yours by copying and pasting a webpage address.
    Your question as stated is a bit unanswerable. You've described some of your goal, but not what's preventing you from getting to that goal. There are a million different ways to do something in programming, and you could be confused about a million different things. It's hard to answer "how do I do this" type questions other than to point you to google and to ask specifically what you're confused about.

    Your "question" is a bit like you saying "I want to get to New York. The issue I'm having is getting my car there." That's not enough information for somebody to help you- where are you leaving from? Are you experiencing car trouble? Is there an accident or road work blocking your way? We simply asked you for more detail so we can help you, but if that's not good enough for you, I wish you luck and will add you to my ignore list so as not to waste your time.

    I leave you with one more pasted webpage address, hopefully it is of some help to you: http://www.javaprogrammingforums.com...e-posting.html
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Transparency to bufferedImage
    By Serthy in forum AWT / Java Swing
    Replies: 21
    Last Post: August 29th, 2013, 05:11 AM
  2. [SOLVED] JPanel's BufferedImage Comes Then Goes
    By pict3000 in forum AWT / Java Swing
    Replies: 18
    Last Post: December 8th, 2012, 11:17 PM
  3. byte[] to bufferedImage always NULL?
    By Baraa in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 18th, 2012, 02:08 AM
  4. drawing a BufferedImage onto a JPanel
    By nemo in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 13th, 2010, 07:48 PM
  5. Creating a bufferedimage!
    By Vexst in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: June 16th, 2010, 08:05 AM