Hi,
Here is my code on how I add a JButton onto a JPanel. However, the JButton completely takes over the whole JPanel, how do I set the size of the JButton so it doesn't take over the whole JPanel?
import java.awt.BorderLayout; import javax.swing.*; public class test extends JFrame { public test() { super("Title"); JPanel panel = new JPanel(); add(panel); JButton mybutton = new JButton("TEST BUTTON"); getContentPane().add(mybutton); } }
Here is what it looks like:
Any help is appreciated,
thanks