I've been trying to resize the button or to use the setLocation
and setBounds
methods. It doesn't matter whatever I put in the args the button just never changes.
I need to learn to relocate whether a button, a label, a textfield, any component in the GUI.
Thanks in advance!
private void iniciarComponentes(){
setTitle("PARA QUE SIRVE");
setSize(1280,800);
setLocationRelativeTo(null);
setDefaultCloseOperation(HIDE_ON_CLOSE);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
setUndecorated(true);
setVisible(true);
setLayout(new BorderLayout());
JLabel background = new JLabel(new ImageIcon("C:\\..."));
add(background);
background.setLayout(new FlowLayout());
JButton btnOk = new JButton("OK");
Dimension size = btnOk.getPreferredSize();
btnOk.setBounds(0,0, 10, 10);
btnOk.addActionListener(this);
background.add(btnOk);
}