Change dimensions of JButton
问题 I have problem with this. The button is taking up the entire JFrame. I've tried changing the dimensions of the JFrame and the JButton but with no changed. It's completely hiding a JTable underneath. Could someone please tell me what I'm doing wrong. JFrame FRAME = new JFrame(); JButton BUTTON = new JButton("OK"); FRAME.add(new JScrollPane(TableName)); BUTTON.setPreferredSize(new Dimension(20,30)); FRAME.add(BUTTON); FRAME.setSize(700, 600); FRAME.setVisible(true); FRAME.setLocationRelativeTo