Results 1 to 5 of 5
- 01-11-2012, 05:53 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
- 01-11-2012, 06:11 AM #2
Re: How to create a jbutton to save the jpanel as a jpeg??
Button is easy.
You will need to add an action listener to the button to tell java what to do when the user clicks it. Here is a tutorial for buttons: tutorialJava Code:JButton button = new JButton("Click Me!");
Now as far as saving a jpeg... How are you displaying a calendar? Are you drawing on a JPanel with Java2D? You can draw to a BufferedImage and use ImageIO to write that in your desired format.
- 01-11-2012, 06:20 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: How to create a jbutton to save the jpanel as a jpeg??
Work on one step at a time. Because when comes to a button (actually any control) there are a lot to learn, specially with actions listeners. So you better do some considerable amount of work on it.
- 01-11-2012, 06:23 AM #4
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Re: How to create a jbutton to save the jpanel as a jpeg??
Thank you for the help, I now have a clear direction to do that
- 01-11-2012, 07:23 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: How to create a jbutton to save the jpanel as a jpeg??
You are welcome. Give a try and let us know.
Similar Threads
-
Save a JPanel in NetBeans 7.0.1
By mad72584 in forum New To JavaReplies: 4Last Post: 08-17-2011, 01:16 PM -
Open JPanel with JButton
By web_dev in forum New To JavaReplies: 7Last Post: 06-13-2011, 10:25 PM -
Adding JPEG to JButton Child
By rsieberg in forum AWT / SwingReplies: 3Last Post: 03-27-2011, 08:33 PM -
Need to Save a data to file from JPanel and read the data back to Jpanel
By yashrajsen in forum AWT / SwingReplies: 1Last Post: 11-09-2010, 09:28 AM -
Save image as JPEG
By aartheesrini in forum Java AppletsReplies: 1Last Post: 03-16-2009, 05:56 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks