JPanel colorPanel = new JPanel();
colorPanel.setBackground(Color.white);
colorPanel.setPreferredSize(new Dimension(300, 100));
frame.getContentPane().add(colorPanel);
frame.pack();
frame.show();
Color shade = Color.white;
int again;
do {
shade = JColorChooser.showDialog(frame, "Pick a Color!", shade);
colorPanel.setBackground(shade);