public Teste(){
super();
Container tela = this.getContentPane();
tela.setBackground(Color.GREEN);
painel = new JTable();
painel.setLayout(null);
painel.setBackground(Color.white);
painel.setBounds(20,100,500,500);
Border borda = BorderFactory.createEtchedBorder();
painel.setBorder(BorderFactory.createTitledBorder(borda, "543"));
a = new JLabel("teste");
a.setBounds(100,200,100,20);
b = new JLabel("teste");
b.setBounds(100,300,100,20);
c = new JLabel("teste");
c.setBounds(100,320,100,20);
d = new JLabel("teste");
d.setBounds(100,850,100,20);
JButton button = new JButton("teste");
button.setBackground(Color.pink);
button.setBounds(10,100,200,20);
JButton button1 = new JButton("sdfsfd");
button1.setBackground(Color.red);
button1.setBounds(100,200,10,50);
x = new JScrollPane();
x.setViewportView(painel);
x.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
x.setLayout(null);
painel.add(a);
painel.add(b);
painel.add(c);
painel.add(d);
painel.add(button);
//tela.add(x);
tela.add(painel);
this.setLayout(null);
this.setLocationRelativeTo(null);
this.setResizable(true);
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setVisible(true);
}
Aí pessoal, eu nao consigo redirecionar os botões com nomes “button e button1” os setBounds deles nao funcionam??
como eu posso resolver esse problema??
obrigado pela atenção!
