Results 1 to 2 of 2
  1. #1
    ankit1801 is offline Member
    Join Date
    Mar 2011
    Rep Power

    Exclamation Saving output displayed in a frame in image format

    i have written a program which shows a graph on a frame. now i have to save this output in image format. i have been asked to place a button on the frame which displays the graph clicking on which will save the graph as an image. how to do it?

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    Try something like this:
    Create a buffered image. Get its Graphics object and call the paintComponent method for the frame. The frame will draw itself on the buffered image. Then write that buffered image to an image file.

Similar Threads

  1. output format problem.
    By jim01 in forum New To Java
    Replies: 8
    Last Post: 04-18-2011, 10:00 AM
  2. output is not displayed
    By meth in forum New To Java
    Replies: 0
    Last Post: 01-07-2011, 06:44 AM
  3. Format the output
    By Moustafa taha in forum New To Java
    Replies: 5
    Last Post: 10-18-2010, 06:01 AM
  4. Replies: 3
    Last Post: 09-22-2010, 08:28 PM
  5. ImageIcon : Image not displayed
    By niteshwar.bhardwaj in forum Java 2D
    Replies: 0
    Last Post: 02-13-2009, 08:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts