I have provided you with the code that creates a bordered JPanel to use as the frame's content pane and in which the panel contains two labels and a button. Here is the code :
Code:
public static void main(String[] args) {
JFrame f = new JFrame("Which is that Car?");
JPanel contentPane = new JPanel();
f.setContentPane(contentPane);
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
contentPane.setBorder(BorderFactory.createEmptyBorder(30,30,30,30));
contentPane.add(intro);
contentPane.add(name);
contentPane.add(Box.createRigidArea(new Dimension(0,15)));
contentPane.add(button);
...
}
Bookmarks