getComponentData() to retrieve and return value of object.

Component Java
Build Wizards Quickly Using a Swing-Based Wizard Framework
Chang Sau Sheong
Listing 6. getComponentData() to retrieve and return value of object.


. . .
  public void customize() {

. . .
    Hashtable textBoxes = new Hashtable();
    textBoxes.put("Class Name", new Integer(20));
    textBoxes.put("Package", new Integer(30));
    textBoxes.put("Primary key", new Integer(30));

    tb = new WizardTextBoxPanel(textBoxes);
    centerPane.setLayout(new BorderLayout());
    centerPane.add(tb, BorderLayout.CENTER);
}

public void nextAction() {
  super.nextAction();
  try {
    putData("classname",tb.getComponentData("Class Name"));
    putData("packagename", tb.getComponentData("Package"));
    putData("primarykey",tb.getComponentData("Primary key"));
  }
  catch (Exception e) {
  }
}

}
. . .

About the Author

Chang Sau Sheong is vice president of product engineering at elipva Ltd. (formerly known as sstarfire.com). He can be contacted at [email protected].