コード例 #1
0
  protected void installDefaults() {
    super.installDefaults();

    /* Enable the content pane to inherit background color
     * from its parent by setting its background color to null.
     * Fixes bug#4268949, which has been fixed in 1.4, too. */
    JComponent contentPane = (JComponent) frame.getContentPane();
    if (contentPane != null) {
      Color bg = contentPane.getBackground();
      if (bg instanceof UIResource) contentPane.setBackground(null);
    }
    frame.setBackground(UIManager.getLookAndFeelDefaults().getColor("control"));
  }
コード例 #2
0
  public void uninstallUI(JComponent c) {
    frame = (JInternalFrame) c;

    c.removePropertyChangeListener(paletteListener);
    c.removePropertyChangeListener(contentPaneListener);

    Container cont = ((JInternalFrame) (c)).getContentPane();
    if (cont instanceof JComponent) {
      JComponent content = (JComponent) cont;
      if (content.getBorder() == EMPTY_BORDER) {
        content.setBorder(null);
      }
    }
    super.uninstallUI(c);
  }
コード例 #3
0
  public void installUI(JComponent c) {
    frame = (JInternalFrame) c;

    paletteListener = new PaletteListener(this);
    contentPaneListener = new ContentPaneListener(this);
    c.addPropertyChangeListener(paletteListener);
    c.addPropertyChangeListener(contentPaneListener);

    super.installUI(c);

    Object paletteProp = c.getClientProperty(IS_PALETTE);
    if (paletteProp != null) {
      setPalette(((Boolean) paletteProp).booleanValue());
    }

    Container content = frame.getContentPane();
    stripContentBorder(content);
  }