Ok so I have this panel and 2 buttons. I want to add space between the buttons. Here's my code:
smallpan.setPreferredSize(new Dimension(100,100));
smallpan.setBackground(Color.white);
panel2.setPreferredSize(new Dimension(100, 100));
panel2.setBackground(Color.white);
panel2.add(smallpan);
panel2.add(x);
panel2.add(y);