File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes how to get image from JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to get image from JPanel" Watch "how to get image from JPanel" New topic

how to get image from JPanel

Bobby Marvikuan
Ranch Hand

Joined: Mar 14, 2012
Posts: 54
So, as I understood(may be not correctly) in order to save an image I need a bufferedImage to read from some image like


but if I don't have an image I mean I have it but on my JPanel and it is exactly the image that I want to save how can I do then???
Rob Spoor

Joined: Oct 27, 2005
Posts: 19651

How did you get it onto your JPanel? Is it an ImageIcon wrapped in a JLabel? Or did you create it in paintComponent?

How To Ask Questions How To Answer Questions
Don't get me started about those stupid light bulbs.
subject: how to get image from JPanel
Similar Threads
After screen Capture(to a Gif File)?????????
adding images to JPanel ***************URGENT
Writing Image onto a WordDoc
applet x/y coordinates
BufferedImage questions.