add(jb);
add(new JToggleButton("JToggleButton"));
add(new JCheckBox("JCheckBox"));
add(new JRadioButton("JRadioButton"));
up.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
spin.setValue(spin.getValue() + 1);
}
});
down.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
spin.setValue(spin.getValue() - 1);
}
});
JPanel jp = new JPanel();
jp.add(spin);
jp.add(up);
jp.add(down);
jp.setBorder(new TitledBorder("Spinner"));
add(jp);
left.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
stringSpin.setValue(
stringSpin.getValue() + 1);
}
});
right.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
stringSpin.setValue(
stringSpin.getValue() - 1);
}
});
jp = new JPanel();
jp.add(stringSpin);
jp.add(left);
jp.add(right);
jp.setBorder(
new TitledBorder("StringSpinner"));
add(jp);