< prev index next >

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

Print this page

        

@@ -131,10 +131,11 @@
      * @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,10 +653,11 @@
         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,10 +685,11 @@
         }
         // end esc handling
 
         cancelButton.setActionCommand("cancel");
         cancelButton.addActionListener(new ActionListener() {
+            @SuppressWarnings("deprecation")
             public void actionPerformed(ActionEvent e) {
                 hide();
             }
         });
         if (cancelListener != null) {

@@ -721,10 +724,11 @@
         setLocationRelativeTo(c);
 
         this.addWindowListener(new Closer());
     }
 
+    @SuppressWarnings("deprecation")
     public void show() {
         initialColor = chooserPane.getColor();
         super.show();
     }
 

@@ -732,10 +736,11 @@
         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 >