示例#1
0
  protected void installDefaults(AbstractButton b) {
    // load shared instance defaults
    String pp = getPropertyPrefix();

    defaultTextShiftOffset = UIManager.getInt(pp + "textShiftOffset");

    // set the following defaults on the button
    if (b.isContentAreaFilled()) {
      LookAndFeel.installProperty(b, "opaque", Boolean.TRUE);
    } else {
      LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
    }

    if (b.getMargin() == null || (b.getMargin() instanceof UIResource)) {
      b.setMargin(UIManager.getInsets(pp + "margin"));
    }

    LookAndFeel.installColorsAndFont(b, pp + "background", pp + "foreground", pp + "font");
    LookAndFeel.installBorder(b, pp + "border");

    Object rollover = UIManager.get(pp + "rollover");
    if (rollover != null) {
      LookAndFeel.installProperty(b, "rolloverEnabled", rollover);
    }

    LookAndFeel.installProperty(b, "iconTextGap", new Integer(4));
  }
 protected void installDefaults() {
   LookAndFeel.installColorsAndFont(
       optionPane, "OptionPane.background", "OptionPane.foreground", "OptionPane.font");
   LookAndFeel.installBorder(optionPane, "OptionPane.border");
   minimumSize = UIManager.getDimension("OptionPane.minimumSize");
   LookAndFeel.installProperty(optionPane, "opaque", Boolean.TRUE);
 }
 protected void installDefaults(JFileChooser fc) {
   installIcons(fc);
   installStrings(fc);
   usesSingleFilePane = UIManager.getBoolean("FileChooser.usesSingleFilePane");
   readOnly = UIManager.getBoolean("FileChooser.readOnly");
   TransferHandler th = fc.getTransferHandler();
   if (th == null || th instanceof UIResource) {
     fc.setTransferHandler(defaultTransferHandler);
   }
   LookAndFeel.installProperty(fc, "opaque", Boolean.FALSE);
 }
 protected void installDefaults() {
   LookAndFeel.installProperty(progressBar, "opaque", Boolean.TRUE);
   LookAndFeel.installBorder(progressBar, "ProgressBar.border");
   LookAndFeel.installColorsAndFont(
       progressBar, "ProgressBar.background", "ProgressBar.foreground", "ProgressBar.font");
   cellLength = UIManager.getInt("ProgressBar.cellLength");
   if (cellLength == 0) cellLength = 1;
   cellSpacing = UIManager.getInt("ProgressBar.cellSpacing");
   selectionForeground = UIManager.getColor("ProgressBar.selectionForeground");
   selectionBackground = UIManager.getColor("ProgressBar.selectionBackground");
 }
 protected void installDefaults() {
   if (desktop.getBackground() == null || desktop.getBackground() instanceof UIResource) {
     desktop.setBackground(UIManager.getColor("Desktop.background"));
   }
   LookAndFeel.installProperty(desktop, "opaque", Boolean.TRUE);
 }
示例#6
0
 protected void installDefaults(JPanel p) {
   LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground", "Panel.font");
   LookAndFeel.installBorder(p, "Panel.border");
   LookAndFeel.installProperty(p, "opaque", Boolean.TRUE);
 }