import java.awt.*; // // Panels for the New Account dialog // class TypePanel extends Panel { Label typeLabel=new Label("Type: "); Choice accountType; public TypePanel() { setLayout(new GridLayout(1,2)); accountType= new Choice(); accountType.addItem("Checking"); accountType.addItem("Savings"); accountType.addItem("CD"); accountType.addItem("Loan"); accountType.select("Checking"); add(typeLabel); add(accountType); } } class NamePanel extends Panel { Label label; TextField text; public NamePanel() { setLayout(new GridLayout(1,2)); label=new Label("Account name: "); text=new TextField(20); add(label); add(text); } } class LabelPanel extends NamePanel { public LabelPanel(String labelstr) { super(); label.setText(labelstr); } } class InterestPanel extends LabelPanel { public InterestPanel() { super("interest: "); text.setEditable(false); } } class DepositPanel extends LabelPanel { public DepositPanel() { super("initial ammount: "); text.setEditable(false); } } class PeriodPanel extends LabelPanel { public PeriodPanel() { super("period: "); text.setEditable(false); } } class NewControlsPanel extends Panel { TypePanel typePanel; NamePanel namePanel; InterestPanel interestPanel; DepositPanel depositPanel; PeriodPanel periodPanel; public NewControlsPanel() { setLayout(new GridLayout(5,1)); typePanel=new TypePanel(); add(typePanel); typePanel.show(); namePanel=new NamePanel(); add(namePanel); namePanel.show(); interestPanel=new InterestPanel(); add(interestPanel); interestPanel.show(); interestPanel.text.setEditable(true); depositPanel=new DepositPanel(); add(depositPanel); depositPanel.show(); periodPanel=new PeriodPanel(); add(periodPanel); periodPanel.show(); } public Insets insets() { return new Insets(10,10,1,10); } }