-4

Can any one suggest me the basic steps to make a 'Recently Opened' i.e. History type functionality in Java Swing using JScrollPane, JTextArea` and so on.

What ever different frames like frame1, frame2, frame3 etc, we open its name will be listed dynamically in this text area which is a part of main screen(a main jframe). If we click on any one of list generated in the 'Recently opened' text area that corresponding frame will show again.

Kindly reply, I need it in my project. Please see the figure here:

figure

Thanks.

Community
  • 1
  • 1
Mitu_Chennai
  • 11
  • 1
  • 3

1 Answers1

0

If the history is for a single object like a tabbed pane (http://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html), you can making a subclass of the class and overloading the selection method, to create a history element.

The question is a bit vague, so it is hard to be more specific. But you should likely look towards overloading methods in whatever classes you will be using.

Martin Nielsen
  • 1,865
  • 6
  • 30
  • 54
  • Thanks Martin for reply. But I'm not using tabbed pane. I'm simply using jframe. please see the figure I attached. – Mitu_Chennai Dec 28 '12 at 09:58
  • Sorry as new user I'm unable to attach img. Please see the figure here: http://i45.tinypic.com/r2j9rr.jpg – Mitu_Chennai Dec 28 '12 at 10:08
  • I might have been unclear. One way to do this would be to subclass the menues where you perform your actions, and make those create some sort of history element when they are activated. – Martin Nielsen Dec 28 '12 at 10:54