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

Thread: Save JPanel as image

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Save JPanel as image

    hi.. i want to save the JPanel graphics works as a jpg image. any idea?


  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: Save JPanel as image

    So override paint, replace the Graphics with a BufferedImage's Graphics, draw to that, then save that as a file.
    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. [SOLVED] Can't Import AWT Image into custom JPanel
    By JavaSquared in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 9th, 2011, 12:59 AM
  2. painting Image on JPanel inside a JScrollPane
    By becca23 in forum AWT / Java Swing
    Replies: 1
    Last Post: September 29th, 2010, 07:28 PM
  3. How to copy image from one jpanel to another jpanel
    By ramanavarayuri1986 in forum AWT / Java Swing
    Replies: 0
    Last Post: February 15th, 2010, 02:36 AM
  4. Drawing image on JPanel from another frame
    By jeryslo in forum AWT / Java Swing
    Replies: 3
    Last Post: December 8th, 2009, 04:01 PM
  5. Creating and displaying a JPanel inside another JPanel
    By JayDuck in forum AWT / Java Swing
    Replies: 1
    Last Post: April 7th, 2009, 08:02 AM