/** Update the model when the user selects a color, and repaint the window. */ public void valueChanged(ListSelectionEvent event) { Color color = view.getSelectedColor(); model.setSelectedColor(color); view.repaint(); }