コード例 #1
0
  public void uninstallUI(JComponent c) {
    uninstallListeners(filechooser);
    uninstallComponents(filechooser);
    uninstallDefaults(filechooser);

    if (accessoryPanel != null) {
      accessoryPanel.removeAll();
    }

    accessoryPanel = null;
    getFileChooser().removeAll();

    handler = null;
  }
コード例 #2
0
 public void setCommands(String[] names) {
   panel.removeAll();
   panel.add(Box.createHorizontalGlue());
   for (int i = 0; i < names.length; i++) {
     JButton b = new XButton("");
     if (shownames) b.setText(names[i]);
     else b.setToolTipText(names[i]);
     b.setActionCommand(names[i]);
     b.addActionListener(this);
     b.setMargin(new InsetsUIResource(0, 6, 0, 6));
     panel.add(b);
     if (i < names.length - 1) {
       if (isHorisontal()) {
         panel.add(Box.createHorizontalStrut(9));
       } else {
         panel.add(Box.createVerticalStrut(5));
       }
     }
     buttons.put(names[i], b);
   }
   setButtonsSize();
   panel.validate();
 }