/** Performs the action. */
    public void actionPerformed(ActionEvent event) {
      Object cmd = getValue("__command__");
      JToolBar toolBar = (JToolBar) event.getSource();
      BasicToolBarUI ui = (BasicToolBarUI) toolBar.getUI();

      if (cmd.equals("navigateRight")) ui.navigateFocusedComp(EAST);
      else if (cmd.equals("navigateLeft")) ui.navigateFocusedComp(WEST);
      else if (cmd.equals("navigateUp")) ui.navigateFocusedComp(NORTH);
      else if (cmd.equals("navigateDown")) ui.navigateFocusedComp(SOUTH);
      else assert false : "Shouldn't reach here";
    }
Example #2
0
 /** Set a toolbar to be initially floating. This doesn't quite work right. */
 protected void setFloating(JToolBar toolBar) {
   // ((javax.swing.plaf.basic.BasicToolBarUI) toolBar.getUI()).setFloatingLocation(100,100);
   ((javax.swing.plaf.basic.BasicToolBarUI) toolBar.getUI())
       .setFloating(true, new Point(500, 500));
 }