Package javax.swing

Examples of javax.swing.JMenuBar


   *
   * @return javax.swing.JMenuBar
   */
  private JMenuBar getMainJMenuBar() {
    if (mainJMenuBar == null) {
      mainJMenuBar = new JMenuBar();
      mainJMenuBar.add(getFileMenu());
      mainJMenuBar.add(getWindowMenu());
      mainJMenuBar.add(getHelpMenu());
    }
    return mainJMenuBar;
View Full Code Here


    }

    final JPanel playListPanel = new PlayListPanel();
    this.aurousFrame.getContentPane().add(playListPanel, BorderLayout.WEST);

    final JMenuBar menuBar = new AurousBar();

    this.aurousFrame.setJMenuBar(menuBar);

    final JPanel tabelPanel = new TabelPanel();
    this.aurousFrame.getContentPane().add(tabelPanel, BorderLayout.CENTER);
View Full Code Here

   
    private MouseInputAdapter handler;

    public AnalyseMenu()
    {
        menuBar = new JMenuBar() {
            public void paintComponent(Graphics g)
            {
                super.paintComponent(g);

                Graphics2D g2d = (Graphics2D) g;
View Full Code Here

          System.exit(0);
        }
      });

      // add a menu bar
      JMenuBar mb = new JMenuBar();
      JMenu file = new JMenu("File");
      file.setMnemonic(KeyEvent.VK_F);
      JMenuItem tmp;
      file.add(tmp = new JMenuItem("Connect"));
      tmp.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.SHIFT_MASK | KeyEvent.CTRL_MASK));
      tmp.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          String destination =
                  JOptionPane.showInputDialog(frame,
                                              new JLabel("Enter your destination host (host[:port])"),
                                              "Connect", JOptionPane.QUESTION_MESSAGE
                  );
          if (destination != null) {
            int sep = 0;
            if ((sep = destination.indexOf(' ')) > 0 || (sep = destination.indexOf(':')) > 0) {
              host = destination.substring(0, sep);
              port = destination.substring(sep + 1);
            } else {
              host = destination;
            }
            setup.broadcast(new SocketRequest());
            setup.broadcast(new SocketRequest(host, Integer.parseInt(port)));
          }
        }
      });
      file.add(tmp = new JMenuItem("Disconnect"));
      tmp.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          setup.broadcast(new SocketRequest());
        }
      });
      file.addSeparator();
      if (setup.getComponents().get("Terminal") != null) {
        file.add(tmp = new JMenuItem("Print"));
        tmp.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK));
        tmp.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
              PrintJob printJob =
                      frame.getToolkit().getPrintJob(frame, "JTA Terminal", null);
              // return if the user clicked cancel
              if (printJob == null) return;
              ((JComponent) setup.getComponents().get("Terminal"))
                      .print(printJob.getGraphics());
              printJob.end();
          }
        });
        file.addSeparator();
      }
      file.add(tmp = new JMenuItem("Exit"));
      tmp.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          frame.dispose();
          System.exit(0);
        }
      });
      mb.add(file);

      JMenu edit = new JMenu("Edit");
      edit.add(tmp = new JMenuItem("Copy"));
      tmp.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK));
      tmp.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          if (focussedPlugin instanceof VisualTransferPlugin)
            ((VisualTransferPlugin) focussedPlugin).copy(clipboard);
        }
      });
      edit.add(tmp = new JMenuItem("Paste"));
      tmp.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK));
      tmp.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          if (focussedPlugin instanceof VisualTransferPlugin)
            ((VisualTransferPlugin) focussedPlugin).paste(clipboard);
        }
      });
      mb.add(edit);

      Map menuList = setup.getMenus();
      names = menuList.keySet().iterator();
      while (names.hasNext()) {
        String name = (String) names.next();
        mb.add((JMenu) menuList.get(name));
      }

      JMenu help = new JMenu("Help");
      help.setMnemonic(KeyEvent.VK_HELP);
      help.add(tmp = new JMenuItem("General"));
      tmp.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Help.show(frame, options.getProperty("Help.url"));
        }
      });
      mb.add(help);

      frame.setJMenuBar(mb);

    } // !personalJava
View Full Code Here

    cutAndPaste = new CutAndPastePopup(action);
    popup = cutAndPaste.getPopupMenu();

    // Create menu and status bar
    myMenu = new MyMenu(this);
    JMenuBar menubar = new JMenuBar();
    menubar.add(myMenu.createFileMenu());
    menubar.add(myMenu.createEditMenu());
    menubar.add(myMenu.createConfigMenu());
    menubar.add(myMenu.createHelpMenu());
    setJMenuBar(menubar);
    getContentPane().add(myMenu.createStatusBar(), "South");
    getContentPane().add(new JScrollPane(pane), "Center");

    pane.setEditable(true);
View Full Code Here

  }


  @Override
  public void compose(final MProgressBar progressBar) {
    widget = new JMenuBar();
    composeDrawingMenu();
    composeEditMenu();
    if(progressBar!=null) progressBar.addToProgressBar(5);
    composeDisplayMenu();
    composeHelpMenu();
View Full Code Here

        toolBar.addSeparator();
        toolBar.add(clearAction);
        toolBar.add(showDetailsAction);
        getContentPane().add(toolBar, BorderLayout.NORTH);
       
        JMenuBar mb = new JMenuBar();
       
        JMenu menu = new JMenu("File");
        mb.add(menu);
       
        menu.add(connectAction);
        menu.add(disconnectAction);
        menu.addSeparator();
        menu.add(clearAction);
View Full Code Here

        connectionHistory = new ConnectionHistory(recentConnectionMenu);
        jobTableModel.addJobTableModelListener(connectionHistory);
    }
   
    private void initMenuBar() {
        JMenuBar mb = new JMenuBar();
        JMenu fileMenu = new JMenu("File");
        fileMenu.add(new ConnectAction());
        fileMenu.add(recentConnectionMenu);
        fileMenu.addSeparator();
        fileMenu.add(new ExitAction());
        mb.add(fileMenu);
        setJMenuBar(mb);
    }
View Full Code Here

    assertThat(Formatting.formatter(JList.class)).isInstanceOf(JListFormatter.class);
  }

  @Test
  public void should_format_JMenuBar() {
    JMenuBar menuBar = menuBar().createNew();
    assertThat(formatted(menuBar)).isEqualTo("javax.swing.JMenuBar[]");
  }
View Full Code Here

      });
    }

    private MyWindow() {
      super(MenuElementComponentQuery_componentIn_Test.class);
      setJMenuBar(new JMenuBar());
      getJMenuBar().add(menu);
      setPreferredSize(new Dimension(80, 60));
    }
View Full Code Here

TOP

Related Classes of javax.swing.JMenuBar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.