class CommandAPDUField {
/**
* Constructs a new field.
*/
public CommandAPDUField() {
setLayout(new GridLayout(2,1));
JPanel topPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
JLabel claLbl = new JLabel("cla:"); topPnl.add(claLbl);
claTF = new HexField(); topPnl.add(claTF);
JLabel insLbl = new JLabel("ins:"); topPnl.add(insLbl);
insTF = new HexField(); topPnl.add(insTF);
JLabel p1Lbl = new JLabel("p1:"); topPnl.add(p1Lbl);
p1TF = new HexField(); topPnl.add(p1TF);
JLabel p2Lbl = new JLabel("p2:"); topPnl.add(p2Lbl);
p2TF = new HexField(); topPnl.add(p2TF);
JLabel leLbl = new JLabel("le:"); topPnl.add(leLbl);
leTF = new HexField(); topPnl.add(leTF);
leLbl.setEnabled(false);
leTF.setEnabled(false);
leCheckBox = new JCheckBox();
ComponentToggler leToggler = new ComponentToggler();
leToggler.add(leLbl);
leToggler.add(leTF);
leCheckBox.addActionListener(leToggler);
topPnl.add(leCheckBox);
add(topPnl);
JPanel botPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
botPnl.setAlignmentX(JPanel.LEFT_ALIGNMENT);
cdataTF = new HexArrayField();
botPnl.add(cdataTF);
add(botPnl);
setBorder(BorderFactory.createTitledBorder(PANEL_BORDER, "Command APDU"));
}
}
class CommandAPDUField.ComponentToggler {
/**
* Creates a new toggler.
*/
public ComponentToggler() {
components = new ArrayList();
}
}
|