src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -58,19 +58,21 @@
      * {@inheritDoc}
      */
     @Override
     protected void installComponents() {
         if (UIManager.getBoolean("InternalFrame.useTaskBar")) {
-            iconPane = new JToggleButton(frame.getTitle(), frame.getFrameIcon()) {
+            @SuppressWarnings("serial") // anonymous class
+            JToggleButton tmp = new JToggleButton(frame.getTitle(), frame.getFrameIcon()) {
                 @Override public String getToolTipText() {
                     return getText();
                 }
 
                 @Override public JPopupMenu getComponentPopupMenu() {
                     return frame.getComponentPopupMenu();
                 }
             };
+            iconPane = tmp;
             ToolTipManager.sharedInstance().registerComponent(iconPane);
             iconPane.setFont(desktopIcon.getFont());
             iconPane.setBackground(desktopIcon.getBackground());
             iconPane.setForeground(desktopIcon.getForeground());
         } else {