< prev index next >

src/java.desktop/share/classes/javax/swing/JColorChooser.java

Print this page

        

*** 131,140 **** --- 131,141 ---- * @return the selected color or <code>null</code> if the user opted out * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless */ + @SuppressWarnings("deprecation") public static Color showDialog(Component component, String title, Color initialColor) throws HeadlessException { final JColorChooser pane = new JColorChooser(initialColor != null? initialColor : Color.white);
*** 652,661 **** --- 653,663 ---- JButton okButton = new JButton(okString); getRootPane().setDefaultButton(okButton); okButton.getAccessibleContext().setAccessibleDescription(okString); okButton.setActionCommand("OK"); okButton.addActionListener(new ActionListener() { + @SuppressWarnings("deprecation") public void actionPerformed(ActionEvent e) { hide(); } }); if (okListener != null) {
*** 683,692 **** --- 685,695 ---- } // end esc handling cancelButton.setActionCommand("cancel"); cancelButton.addActionListener(new ActionListener() { + @SuppressWarnings("deprecation") public void actionPerformed(ActionEvent e) { hide(); } }); if (cancelListener != null) {
*** 721,730 **** --- 724,734 ---- setLocationRelativeTo(c); this.addWindowListener(new Closer()); } + @SuppressWarnings("deprecation") public void show() { initialColor = chooserPane.getColor(); super.show(); }
*** 732,741 **** --- 736,746 ---- chooserPane.setColor(initialColor); } @SuppressWarnings("serial") // JDK-implementation class class Closer extends WindowAdapter implements Serializable{ + @SuppressWarnings("deprecation") public void windowClosing(WindowEvent e) { cancelButton.doClick(0); Window w = e.getWindow(); w.hide(); }
< prev index next >