} else if (e.getSource() == ColorButton) { ColorChooser chooser = new ColorChooser(); int result = JOptionPane.showConfirmDialog(this, chooser, "Color Chooser", JOptionPane.OK_CANCEL_OPTION); if (result == JOptionPane.OK_OPTION) { currentPaintColor = chooser.getChoosenColor(); } } //clear all