aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes My Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "My Query " Watch "My Query " New topic
Author

My Query

Bharati GM
Greenhorn

Joined: Jun 25, 2001
Posts: 2
Hello Sir,
I am developing an Appliction using Java swings(JFRAME,JPanel other components) In that I am Using two JButtons(For BACK and FORWORD).If I click On BACK button I need to get the Previous Frame Content and If Click on FORWORD JButton I need to get updated Contents.
I've tried with UNDO() Package but then also I did not the Required output.Help me to get these Functions.
Thanks in Advance,
Bharati
Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
Hi Bharati,
It depends on the situation whether you are interested in changing the components of the frame or whether you want to change the data in the components on the fram.
For changing the components you may use the Card layout and show a card at a time and use the back and forward buttons to go thru the cards.
For changing the data. Define a class that can hold all data to be displayed on the form. Use a vector or a linkedlist to store instances of the data objects. maintain an index (int) to keep track of where you are in the data list. when you press the back button, decrement the index by 1 and display the data of corresponding object from the vector. when you press the forward button increment the index by 1. you will have to check for the extreme cases that is beginning of list and end of list.
----------
Amit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My Query
 
Similar Threads
need a Help(very Urgent)
Re: Navigation Restriction
sendRedirect (), forword ()
Form in request.
jsp:forward page="/