public class ButtonNumeros {
public static void main(String[] args) {
// TODO Auto-generated method stub
create();
}
public static void create() {
//s
JFrame frame = new JFrame("Radio Buttons");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setSize(500, 500);
frame.add(paint());
}
public static JPanel paint() {
int numero;
JPanel panel = new JPanel();
JButton boton1, boton2, boton3,boton4, boton5, boton6,boton7, boton8, boton9;
boton1 = new JButton("1");
panel.add(boton1);
boton2 = new JButton("2");
panel.add(boton2);
boton3 = new JButton("3");
panel.add(boton3);
boton4 = new JButton("4");
panel.add(boton4);
boton5 = new JButton("5");
panel.add(boton5);
boton6 = new JButton("6");
panel.add(boton6);
boton7 = new JButton("7");
panel.add(boton7);
boton8 = new JButton("8");
panel.add(boton8);
boton9 = new JButton("9");
panel.add(boton9);
boton1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
return panel;
}
}
}