westpan.setBorder(new TitledBorder("West Panel"));
westpan.setLayout(new BoxLayout(westpan, BoxLayout.Y_AXIS));
JLabel label1 = new JLabel("Magenta label in west panel");
westpan.add(label1);
label1.setForeground(Color.magenta);
JTextField textfield1 = new JTextField(
"Cyan JTextField, red background");
textfield1.setForeground(Color.cyan);
textfield1.setBackground(Color.red);
westpan.add(textfield1);
JTextField whiteTextField = new JTextField("White JTextField");
whiteTextField.setForeground(Color.white);
westpan.add(whiteTextField);
JTextField blueTextField = new JTextField("Blue JTextField");
blueTextField.setForeground(Color.blue);
westpan.add(blueTextField);
JTextField yellowTextField = new JTextField("Yellow JTextField");
yellowTextField.setForeground(Color.yellow);
westpan.add(yellowTextField);
JTextField blackTextField = new JTextField("Black JTextField");
blackTextField.setForeground(Color.black);
westpan.add(blackTextField);
contentPane.add(westpan, BorderLayout.WEST);
JPanel eastpan = new JPanel();
eastpan.setForeground(Color.black);
eastpan.setBorder(new TitledBorder("East Panel"));
eastpan.add(new JTextField("A JTextField"));
contentPane.add(eastpan, BorderLayout.EAST);
JPanel centerpan = new JPanel();
centerpan.setForeground(Color.white);
centerpan.setBackground(Color.black);