Example usage for javax.swing UIDefaults put

List of usage examples for javax.swing UIDefaults put

Introduction

In this page you can find the example usage for javax.swing UIDefaults put.

Prototype

public Object put(Object key, Object value) 

Source Link

Document

Sets the value of key to value for all locales.

Usage

From source file:uk.sipperfly.ui.Exactly.java

private void jProgressBar2PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jProgressBar2PropertyChange
    UIDefaults defaults = new UIDefaults();
    defaults.put("ProgressBar[Enabled].foregroundPainter", new MyPainter(new Color(0, 102, 0)));
    defaults.put("ProgressBar[Enabled+Finished].foregroundPainter", new MyPainter(new Color(0, 102, 0)));
}

From source file:uk.sipperfly.ui.Exactly.java

private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
    this.warning.setVisible(false);
    this.btnTransferFiles.setEnabled(false);
    this.btnCancel.setVisible(true);
    List<String> validDirs = new ArrayList<String>();
    List<String> directories = new ArrayList<String>();
    directories = this.uIManager.getInputDirectories();
    directories.add(editInputDir.getText());
    for (String directory : directories) {
        if (!directory.isEmpty()) {
            validDirs.add(directory);/* ww  w. j  ava  2s .c o m*/
        }
    }

    UIDefaults defaults = new UIDefaults();
    defaults.put("ProgressBar[Enabled].foregroundPainter", new MyPainter(new Color(0, 102, 0)));
    defaults.put("ProgressBar[Enabled+Finished].foregroundPainter", new MyPainter(new Color(0, 102, 0)));
    this.jProgressBar2.putClientProperty("Nimbus.Overrides.InheritDefaults", Boolean.TRUE);
    this.jProgressBar2.putClientProperty("Nimbus.Overrides", defaults);

    try {
        bgw = new BackgroundWorker(validDirs, this, 1);
        bgw.execute();
    } catch (IOException ex) {
        this.btnCancel.setVisible(false);
        this.btnTransferFiles.setEnabled(true);
        Logger.getLogger(GACOM).log(Level.SEVERE, null, ex);
    }
}