コード例 #1
0
    /** 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";
    }
コード例 #2
0
ファイル: Apps3.java プロジェクト: oscarmoutinho/JMRI
 /** 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));
 }