0

Is it possible in a Java applet that when user clicks a button, he is guided to some another page on same applet (just as we are guided to different pages on a browser using HTML), while the data on previous page is being preserved?

If yes, then what are the methods that can fulfill such functionality?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Jainam Jhaveri
  • 1,479
  • 1
  • 18
  • 31

3 Answers3

2

If below is what you mean, you can do it by using JTabbedPane:

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
smiche2
  • 71
  • 6
1

Sure. Java applets are fully featured applications (running in a security sandbox).

You can use a UI Framework and use buttons and tab panes to switch between contents.

Have a look at JavaFX: http://docs.oracle.com/javase/8/javase-clienttechnologies.htm which is the Rich UI framework for java nowadays.

P.S. If you need to switch between HTML pages, where each page contains an applet. You'll need to pass arguments to each of the applets in order to keep state.

kmandov
  • 3,130
  • 16
  • 15
1

Swing or AWT components? (I suggest use Swing, and based on that..)

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433