I've created a jFrame form in a package in netbeans. The project is without a main class. I've placed a button from the palette. The following is the code for the button:
int x = jButton1.getHorizontalAlignment();
int y = jButton1.getVerticalAlignment();
JButton button2=new JButton();
button2.setBounds(200, 200, 100, 100);
button2.setVisible(true);
The second button will not show. Why? the x and y are to be used later for relative positioning. I would also like to know how to do that besides x+something and y+something in the coordinate parameters of the .setBounds().