Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2003

Tip: Looking for answers? Try searching our database.

Create java image from Jpanel without displaying

Thread view: 
Moth - 02 Dec 2003 21:13 GMT
I have a PlotPanel class that extends JPanel which I have used previously to
display charts in swing guis.  I now want to display a graph in a jsp page
so I was going to generate the graph and then save it to a jpeg and then
display it in the page.

Is there anyway to create an Image from a JPanel without actually displaying
it in a JFrame first?  Can anyone suggest a better way to create a chart
image for servlet/jsp?
ak - 05 Dec 2003 07:13 GMT
> Is there anyway to create an Image from a JPanel without actually displaying
> it in a JFrame first?
forget JPanel - create BufferedImage and get Graphics from it. Draw your
graph to this Graphics.

> so I was going to generate the graph and then save it to a jpeg and then
> display it in the page.

Use ImageIO to save image.

--

____________

http://reader.imagero.com the best java image reader.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.