So, I have this JFrame code, where everything seems to go well, and there are no errors, but all the components (except for one component) are ignoring the Y and X axis. Why is this happening? I even tried inserting some extremely ridiculous Y axis, such as 456789 or even -80, and it stays the same. Why?
My code:
frame.setSize(750,200);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
frame.setContentPane(panel);
textField.setBounds(0,0,40,200);
textField.setVisible(true);
panel.add(textField);
button.setBounds(200, 0, 40, 200);
button.setVisible(true);
panel.add(button);
bInfo.setBounds(0,80,40,400);
bInfo.setVisible(false);
panel.add(bInfo);
label.setBounds(0,40,40,160);
label.setVisible(false);
panel.add(label);
registerButton();
registerMoreInfoButton();
frame.setVisible(true);
Thanks in advance! :)