01: /**
02: * Created on Dec 2, 2004
03: *
04: * @author karthikeyanr
05: *
06: */package example;
07:
08: import java.awt.GridLayout;
09:
10: import javax.swing.*;
11:
12: import wizard.ui.AbstractMagicPanel;
13:
14: public class SecondCard extends AbstractMagicPanel {
15: private JCheckBox cb;
16:
17: private JTextField tf;
18:
19: public SecondCard() {
20: super ("second");
21: setLayout(new GridLayout(2, 1));
22: }
23:
24: public String getTitle() {
25: return "Second Card";
26: }
27:
28: public boolean validatePanel() {
29: return true;
30: }
31:
32: protected void initComponents() {
33: cb = new JCheckBox("Want to go to the fourth panel directly");
34: JPanel p = new JPanel();
35: p.add(cb);
36: add(p);
37:
38: tf = new JTextField();
39: add(tf);
40: }
41:
42: public String getNextID() {
43: return cb.isSelected() ? "Fourth" : SUCCESSOR;
44: }
45:
46: protected void populatePanel() {
47: }
48:
49: public boolean validateEarly() {
50: return !(tf.getText().length() == 0);
51: }
52:
53: public String getDescription() {
54: return "description for Second";
55: }
56: }
|