// Create the two shapes, a circle and a square.
mShapeOne = new Ellipse2D.Double(40, 20, 80, 80);
mShapeTwo = new Rectangle2D.Double(60, 40, 80, 80);
setBackground(Color.white);
setLayout(new BorderLayout());
// Create a panel to hold the combo box.
JPanel controls = new JPanel();
// Create the combo box with the names of the area operators.
mOptions = new JComboBox(
new String[] { "outline", "add", "intersection",
"subtract", "exclusive or" }
);
// Repaint ourselves when the selection changes.
mOptions.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ie) {
repaint();
}
});
controls.add(mOptions);
add(controls, BorderLayout.SOUTH);