예제 #1
0
  public void enableControlPanel() {
    boolean bVisible = false;

    int nmembers = buttonPane.getComponentCount();
    for (int k = 0; k < nmembers; k++) {
      Component comp = buttonPane.getComponent(k);
      if (comp != null) {
        if (comp.isVisible() || comp.isEnabled()) {
          bVisible = true;
          break;
        }
      }
    }

    if (bVisible && !buttonPane.isVisible()) {
      Dimension dim = getSize();
      Dimension dim1 = buttonPane.getPreferredSize();
      int w = dim.width;
      int h = dim.height + dim1.height;
      if (dim1.width > w) w = dim1.width;
      if (w < 300) w = 300;
      if (h < 200) h = 200;
      setSize(w, h);
    }
    buttonPane.setVisible(bVisible);
  }
예제 #2
0
 public void actionPerformed(ActionEvent e) {
   if (e.getSource() == enableDefaultEncryption) {
     loadStates();
   } else if (e.getSource() == cmdExpandAdvancedSettings) {
     pnlAdvancedSettings.setVisible(!pnlAdvancedSettings.isVisible());
   }
 }
 public JComponent getPreferredFocusedComponent() {
   return myDesignerCard.isVisible() ? myGlassLayer : myErrorPanel;
 }