private DynamicUIManager() {
    final PropertyChangeListener l =
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent event) {
            handlePropertyChanges();
          }
        };

    UIManager.addPropertyChangeListener(
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent event) {
            if (event.getPropertyName().equals("lookAndFeel")) {
              setupPropertyListener(l);
              fireLookAndFeelChanging();
              fireLookAndFeelChanged();
            }
          }
        });
    UIManager.getDefaults()
        .addPropertyChangeListener(
            new PropertyChangeListener() {
              public void propertyChange(PropertyChangeEvent event) {
                if (!(event.getNewValue() instanceof Class)) handlePropertyChanges();
              }
            });

    setupPropertyListener(l);
  }
Exemple #2
0
 /** _more_ */
 private void init() {
   // L&F may change
   UIManager.addPropertyChangeListener(
       new PropertyChangeListener() {
         public void propertyChange(PropertyChangeEvent e) {
           if (e.getPropertyName().equals("lookAndFeel")) {
             SwingUtilities.updateComponentTreeUI(IndependentDialog.this);
           }
         }
       });
 }
 public MetalworksFrame() {
   super("Metalworks");
   final int inset = 50;
   Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
   setBounds(inset, inset, screenSize.width - inset * 2, screenSize.height - inset * 2);
   buildContent();
   buildMenus();
   this.addWindowListener(
       new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
           quit();
         }
       });
   UIManager.addPropertyChangeListener(new UISwitchListener((JComponent) getRootPane()));
 }
  public FileSystemView() {
    final WeakReference<FileSystemView> weakReference = new WeakReference<FileSystemView>(this);

    UIManager.addPropertyChangeListener(
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent evt) {
            FileSystemView fileSystemView = weakReference.get();

            if (fileSystemView == null) {
              // FileSystemView was destroyed
              UIManager.removePropertyChangeListener(this);
            } else {
              if (evt.getPropertyName().equals("lookAndFeel")) {
                fileSystemView.useSystemExtensionHiding =
                    UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
              }
            }
          }
        });
  }
 private AnimationController() {
   timer.setRepeats(true);
   timer.setCoalesce(true);
   // we need to dispose the controller on l&f change
   UIManager.addPropertyChangeListener(this);
 }