I'm not sure what exactly your program should do but you can use the CardLayout to create the pages like this:
import java.applet.*;
import java.awt.*;
public class test extends Applet {
CardLayout layout = new CardLayout();
Panel card_panel = new Panel();
Panel button_panel = new Panel();
public void init() {
setLayout(new BorderLayout());
button_panel.add(new Button("First"));
button_panel.add(new Button("Prev"));
button_panel.add(new Button("Next"));
button_panel.add(new Button("Last"));
add("North", button_panel);
card_panel.setLayout(layout);
card_panel.add("card1", new Label("This is page1");
//you can add a Frame in stand of Label and allso add as many as you need
}
public boolean action (Event evt, Object arg) {
if(evt.target instanceof Button) {
if(arg.equals("First")) layout.first(card_panel);
else if(arg.equas("Prev")) layout.previous(card_panel);
else if(arg.equas("Next")) layout.next(card_panel);
else if(arg.equas("Last")) layout.last(card_panel);
return true;
}
return false;
}
}
I hope it helps