Example usage for javax.swing JMenu JMenu

List of usage examples for javax.swing JMenu JMenu

Introduction

In this page you can find the example usage for javax.swing JMenu JMenu.

Prototype

public JMenu() 

Source Link

Document

Constructs a new JMenu with no text.

Usage

From source file:edu.pdi2.visual.PDI.java

private void initGUI() {
    try {//from   w  w w .  j  ava 2s.c  o  m
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(null);

        this.setTitle("Procesamiento Digital de Imagenes"); //$NON-NLS-1$
        getContentPane().setBackground(new java.awt.Color(212, 208, 200));
        this.setResizable(false);
        this.addFocusListener(new FocusAdapter() {
            public void focusGained(FocusEvent evt) {
                thisFocusGained(evt);
            }
        });
        {
            jMenuBar1 = new JMenuBar();
            setJMenuBar(jMenuBar1);
            {
                jMenu1 = new JMenu();
                jMenuBar1.add(jMenu1);
                jMenu1.setText("File"); //$NON-NLS-1$
                {
                    jMenuItem1 = new JMenuItem();
                    // jMenu1.add(jMenuItem1);
                    jMenu1.add(getJMenuOpenImage());
                    jMenu1.add(getJSeparator1());
                    jMenu1.add(getJMenuItemExit());

                    jMenuItem1.setText("Open Image"); //$NON-NLS-1$
                    jMenuItem1.addMouseListener(new MouseAdapter() {
                        public void mouseReleased(MouseEvent evt) {
                            jMenuItem1MouseReleased(evt);
                        }

                    });
                }
            }
            {
                jMenu3 = new JMenu();
                jMenuBar1.add(jMenu3);
                jMenuBar1.add(getJMenuView());
                jMenu3.setText("Options"); //$NON-NLS-1$
                jMenu3.setEnabled(false);
                {
                    jMenuItem3 = new JMenuItem();
                    jMenu3.add(getJMenuItem2());
                    jMenu3.add(jMenuItem3);
                    jMenuItem3.setText("False Color Image"); //$NON-NLS-1$
                    jMenuItem3.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            menuFalseColorActionPerformed(evt);
                        }
                    });
                }
                {
                    jMenuItem4 = new JMenuItem();
                    jMenu3.add(jMenuItem4);
                    jMenuItem4.setText("Mesh"); //$NON-NLS-1$
                    jMenuItem4.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            jMenuItem4ActionPerformed(evt);
                        }
                    });
                }
                {
                    jMenu4 = new JMenu();
                    jMenu3.add(jMenu4);
                    jMenu3.add(getJMenuItem5());
                    jMenu3.add(getJGenerarSignature());
                    jMenu4.setText("Image"); //$NON-NLS-1$
                    {
                        jmiCorrectedReflectance = new JMenuItem();
                        jMenu4.add(jmiCorrectedReflectance);
                        jmiCorrectedReflectance.setText("Corrected Reflectance"); //$NON-NLS-1$
                        jmiCorrectedReflectance.setAccelerator(KeyStroke.getKeyStroke("ctrl pressed 1")); //$NON-NLS-1$
                        jmiCorrectedReflectance.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                jmiCorrectedRadianceActionPerformed(evt);
                            }
                        });
                    }
                    {
                        jmiCorrectedRadiance = new JMenuItem();
                        jMenu4.add(jmiCorrectedRadiance);
                        jmiCorrectedRadiance.setText("Corrected Radiance"); //$NON-NLS-1$
                        jmiCorrectedRadiance.setAccelerator(KeyStroke.getKeyStroke("ctrl pressed 2"));
                        jmiCorrectedRadiance.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                jmiCorrectedReflectanceActionPerformed(evt);
                            }
                        });
                    }
                }
            }
        }
        // First we create the instance of DisplayThumbnail with a 0.1
        // scale.
        // dt.setBorder(BorderFactory.createTitledBorder(""));
        // We must register mouse motion listeners to it !

        // Now we create the instance of DisplayJAI to show the region
        // corresponding to the viewport.

        // Set it size.
        {
            image = new JPanel();

            getContentPane().add(image);
            image.setBounds(1, 10, 590, dHeight + 10);
            {
                dj = new DisplayJAIWithAnnotations();
                image.add(dj);
                dj.setBounds(0, 0, dWidth, dHeight);
                dj.setPreferredSize(new Dimension(dWidth, dHeight));
                dj.setMinimumSize(new Dimension(dWidth, dHeight));
                dj.setMaximumSize(new Dimension(dWidth, dHeight));
                dj.setBorder(BorderFactory.createTitledBorder(""));
                dj.addMouseListener(new MouseAdapter() {
                    public void mousePressed(MouseEvent evt) {
                        djMousePressed(evt);
                    }
                });
                dj.addMouseMotionListener(new MouseMotionAdapter() {
                    public void mouseMoved(MouseEvent evt) {
                        djMouseMoved(evt);
                    }

                    public void mouseDragged(MouseEvent evt) {
                        djMouseDragged(evt);
                    }
                });
            }
            getContentPane().add(getLatLon());
        }

        pack();
        this.setSize(604, 579);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:ec.ui.view.AutoCorrelationsView.java

private static JMenu buildMenu(ChartPanel chartPanel) {
    JMenu result = new JMenu();

    result.add(MatrixChartCommand.copySeries(0, 0).toAction(chartPanel)).setText("Copy series");

    JMenu export = new JMenu("Export image to");
    export.add(ChartCommand.printImage().toAction(chartPanel)).setText("Printer...");
    export.add(ChartCommand.copyImage().toAction(chartPanel)).setText("Clipboard");
    export.add(ChartCommand.saveImage().toAction(chartPanel)).setText("File...");
    result.add(export);//from  w  ww. jav a2s  .c  o  m

    return result;
}

From source file:edu.harvard.mcz.imagecapture.encoder.UnitTrayLabelBrowser.java

/**
 * This method initializes jMenu   // w ww. j  a va  2 s  .c  o m
 *    
 * @return javax.swing.JMenu   
 */
private JMenu getJMenu() {
    if (jMenu == null) {
        jMenu = new JMenu();
        jMenu.setText("Edit");
        jMenu.setMnemonic(KeyEvent.VK_E);
        jMenu.add(getJMenuItem());
        jMenu.add(getJMenuItem1());
        jMenu.add(getJMenuItemUndo());
        jMenu.add(getJMenuItemRedo());
        jMenu.add(getJMenuItemAddRow());
    }
    return jMenu;
}

From source file:view.App.java

private void initGUI() {
    try {/* w  w  w  .ja va 2 s  . c o m*/
        {
            jPanel1 = new JPanel();
            BorderLayout jPanel1Layout = new BorderLayout();
            jPanel1.setLayout(jPanel1Layout);
            getContentPane().add(jPanel1, BorderLayout.CENTER);
            jPanel1.setPreferredSize(new java.awt.Dimension(901, 398));
            {
                jPanel2 = new JPanel();
                BoxLayout jPanel2Layout = new BoxLayout(jPanel2, javax.swing.BoxLayout.Y_AXIS);
                jPanel2.setLayout(jPanel2Layout);
                jPanel1.add(jPanel2, BorderLayout.WEST);
                jPanel2.setPreferredSize(new java.awt.Dimension(292, 446));
                {
                    jPanel5 = new JPanel();
                    jPanel2.add(jPanel5);
                    jPanel5.setPreferredSize(new java.awt.Dimension(292, 109));
                    {
                        {
                            jTextArea1 = new JTextArea();
                            jTextArea1.setWrapStyleWord(true);
                            jTextArea1.setLineWrap(true);
                            DefaultCaret caret = (DefaultCaret) jTextArea1.getCaret();
                            caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);

                            jTextArea1.addFocusListener(new FocusAdapter() {
                                public void focusGained(FocusEvent evt) {

                                    if (jTable1.getModel().getRowCount() == 0 && !jButton1.isEnabled()) {
                                        jButton1.setEnabled(true);
                                        jTextArea1.setText("");
                                    }

                                }
                            });
                            JScrollPane sp = new JScrollPane();
                            sp.setPreferredSize(new java.awt.Dimension(281, 97));
                            sp.setViewportView(jTextArea1);

                            jPanel5.add(sp, BorderLayout.CENTER);
                        }
                    }

                }
                {
                    jPanel4 = new JPanel();
                    jPanel2.add(jPanel4);
                    FlowLayout jPanel4Layout = new FlowLayout();
                    jPanel4Layout.setAlignment(FlowLayout.RIGHT);
                    jPanel4.setPreferredSize(new java.awt.Dimension(292, 45));
                    jPanel4.setSize(102, 51);
                    jPanel4.setLayout(jPanel4Layout);
                    {
                        jButton1 = new JButton();
                        jPanel4.add(jButton1);
                        jButton1.setText("Get Quotes");
                        jButton1.setSize(100, 50);
                        jButton1.setPreferredSize(new java.awt.Dimension(100, 26));
                        jButton1.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                //   
                                String tickerStr = jTextArea1.getText();
                                if (tickerStr.equals("") || tickerStr.equals(null)
                                        || tickerStr.equals(" ")) {
                                    jTextArea1.setText(" ");
                                    return;
                                }
                                StringTokenizer tokenizer = new StringTokenizer(tickerStr, " ");
                                String[] tickers = new String[tokenizer.countTokens()];
                                int i = 0;
                                while (tokenizer.hasMoreTokens()) {
                                    tickers[i] = tokenizer.nextToken();
                                    i++;
                                }
                                try {
                                    Controller.getQuotes(tickers);
                                } catch (CloneNotSupportedException e) {
                                    JOptionPane.showMessageDialog(jPanel1, "   ");
                                }
                                jButton1.setEnabled(false);
                            }
                        });
                    }
                }
                {
                    jPanel6 = new JPanel();
                    BorderLayout jPanel6Layout = new BorderLayout();
                    jPanel6.setLayout(jPanel6Layout);
                    jPanel2.add(jPanel6);
                    {
                        jScrollPane1 = new JScrollPane();
                        jPanel6.add(jScrollPane1, BorderLayout.CENTER);
                        jScrollPane1.setPreferredSize(new java.awt.Dimension(292, 341));
                        {
                            TableModel jTable1Model = new DefaultTableModel(null,
                                    new String[] { "", "MA Value", "", "MA Value" });
                            jTable1 = new JTable();

                            jScrollPane1.setViewportView(jTable1);
                            jTable1.setModel(jTable1Model);
                            jTable1.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

                        }
                    }
                }
            }
            {
                jPanel3 = new JPanel();
                BorderLayout jPanel3Layout = new BorderLayout();
                jPanel3.setLayout(jPanel3Layout);
                jPanel1.add(jPanel3, BorderLayout.CENTER);
                {
                    //                  chart = ChartFactory.createLineChart(" ", "dates", "correlation ratio", null, 
                    //                        PlotOrientation.VERTICAL, true, true, false);
                    //                  ChartPanel chartPanel = new ChartPanel(chart);
                    //                  chartPanel.setPreferredSize( new java.awt.Dimension( 560 , 367 ) );
                    //                  jPanel3.add(chartPanel);
                }
                {

                }
            }
        }
        this.setSize(966, 531);
        {
            jMenuBar1 = new JMenuBar();
            setJMenuBar(jMenuBar1);
            {
                jMenu3 = new JMenu();
                jMenuBar1.add(jMenu3);
                jMenu3.setText("File");
                {
                    //                  newFileMenuItem = new JMenuItem();
                    //                  jMenu3.add(newFileMenuItem);
                    //                  newFileMenuItem.setText("New");
                    //                  newFileMenuItem.addActionListener(new ActionListener() {
                    //                     public void actionPerformed(ActionEvent evt) {
                    ////                        jTextArea1.setText("");
                    ////                        DefaultTableModel model = (DefaultTableModel)jTable1.getModel();
                    ////                        model.setRowCount(0);
                    ////                        Controller.clearPortfolio();
                    //                     }
                    //                  });
                }
                {
                    jSeparator2 = new JSeparator();
                    jMenu3.add(jSeparator2);
                }
                {
                    exitMenuItem = new JMenuItem();
                    jMenu3.add(exitMenuItem);
                    exitMenuItem.setText("Exit");
                    exitMenuItem.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            int action = JOptionPane.showConfirmDialog(jPanel1,
                                    "     ?", "Confirm Exit",
                                    JOptionPane.OK_CANCEL_OPTION);

                            if (action == JOptionPane.OK_OPTION)
                                System.exit(0);

                        }
                    });
                }
            }
            {
                jMenu4 = new JMenu();
                jMenuBar1.add(jMenu4);
                jMenu4.setText("Edit");
                {
                    cutMenuItem = new JMenuItem();
                    jMenu4.add(cutMenuItem);
                    cutMenuItem.setText("Cut");
                    cutMenuItem.addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent e) {
                            String txt = jTextArea1.getText();
                            StringSelection selection = new StringSelection(txt);
                            Clipboard clp = Toolkit.getDefaultToolkit().getSystemClipboard();
                            clp.setContents(selection, null);
                            jTextArea1.setText("");

                        }
                    });
                }
                {
                    copyMenuItem = new JMenuItem();
                    jMenu4.add(copyMenuItem);
                    copyMenuItem.setText("Copy");
                    copyMenuItem.addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent arg0) {
                            String txt = jTextArea1.getText();
                            StringSelection selection = new StringSelection(txt);
                            Clipboard clp = Toolkit.getDefaultToolkit().getSystemClipboard();
                            clp.setContents(selection, null);

                        }
                    });
                }
                {
                    pasteMenuItem = new JMenuItem();
                    jMenu4.add(pasteMenuItem);
                    pasteMenuItem.setText("Paste");
                    pasteMenuItem.addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent e) {
                            Clipboard clp = Toolkit.getDefaultToolkit().getSystemClipboard();
                            try {
                                String data = (String) clp.getData(DataFlavor.stringFlavor);
                                jTextArea1.setText(data);
                            } catch (UnsupportedFlavorException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                            } catch (IOException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                            }
                        }
                    });
                }
            }
            {
                jMenu5 = new JMenu();
                jMenuBar1.add(jMenu5);
                jMenu5.setText("Help");
                {
                    helpMenuItem = new JMenuItem();
                    jMenu5.add(helpMenuItem);
                    helpMenuItem.setText("About");
                    helpMenuItem.addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent arg0) {
                            JOptionPane.showMessageDialog(jPanel1,
                                    "    .    r.zhumagulov@gmail.com",
                                    "About", JOptionPane.PLAIN_MESSAGE);

                        }
                    });
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:fi.hoski.remote.ui.Admin.java

private void menuRace() {
    JMenu raceMenu = new JMenu();
    TextUtil.populate(raceMenu, "RACES");
    menuBar.add(raceMenu);//from   w w  w . ja v a2 s.  c o m
    if (isRaceAdmin) {
        raceMenu.add(menuItemUploadRaceSeries());
        raceMenu.add(menuItemEditRaceSeries());
        raceMenu.add(menuItemRemoveRaceSeries());
    }
    raceMenu.add(menuItemDownloadCompetitorsForSailwave());
    raceMenu.add(menuItemInsertCompetitorsToSailwave());
    raceMenu.add(menuItemDownloadCompetitorsAsCSV());
    raceMenu.addSeparator();
    if (isRaceAdmin) {
        raceMenu.add(menuItemUploadRanking());
        raceMenu.add(menuItemEditRanking());
        raceMenu.add(menuItemRemoveRanking());
    }
    raceMenu.addSeparator();
    raceMenu.add(menuItemRaceEmail());
    if (serverProperties.isZonerSMSSupported()) {
        raceMenu.add(menuItemRaceSMS());
    }
    raceMenu.addSeparator();
    raceMenu.add(menuItemAttachRaceSeries());
    raceMenu.add(menuItemRemoveRaceSeriesAttachment());
    raceMenu.addSeparator();
    raceMenu.add(menuItemAddReferencePayments());
    raceMenu.add(menuItemAddOtherPayments());
}

From source file:net.sf.jabref.gui.RightClickMenu.java

private JMenu buildGroupMenu(BibEntry[] bes, boolean add, boolean move) {
    if (bes == null) {
        return null;
    }/*from  w  w w  .java 2 s  .  com*/
    JMenu groupMenu = new JMenu();
    GroupTreeNode groups = metaData.getGroups();
    if (groups == null) {
        groupAddMenu.setEnabled(false);
        groupMoveMenu.setEnabled(false);
        groupRemoveMenu.setEnabled(false);
        return null;
    }

    insertNodes(groupMenu, metaData.getGroups(), bes, add, move);

    return groupMenu;

}

From source file:org.pf.midea.MainUI.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    menuMain = new JMenuBar();
    menuFile = new JMenu();
    menuItemQuit = new JMenuItem();
    menuTools = new JMenu();
    menuConstellations = new JMenu();
    menuItemASK = new JMenuItem();
    menuItemFSK = new JMenuItem();
    menuItemBPSK = new JMenuItem();
    menuItemQPSK = new JMenuItem();
    menuItem8PSK = new JMenuItem();
    menuItem16PSK = new JMenuItem();
    menuItem32PSK = new JMenuItem();
    menuItem16QAM = new JMenuItem();
    menuItem32QAM = new JMenuItem();
    menuItem64QAM = new JMenuItem();
    menuItem256QAM = new JMenuItem();
    menuHelp = new JMenu();
    menuItemAbout = new JMenuItem();
    labelSource = new JLabel();
    SourceCell[] sourceCells = { new SourceCell(PlanStates.SourceType.ST_TEST),
            new SourceCell(PlanStates.SourceType.ST_RANDOM) };
    chooserSource = new JComboBox(sourceCells);
    chooserSource.setRenderer(new SourceCellRenderer());
    buttonAddToPlan = new JButton();
    panelPlan = new JPanel();
    scrollPane1 = new JScrollPane();
    listPlan = new JList();
    labelCode = new JLabel();
    CodeCell[] codeCells = { new CodeCell(PlanStates.CodeType.CT_NONE),
            new CodeCell(PlanStates.CodeType.CT_HAMMING74), new CodeCell(PlanStates.CodeType.CT_CYCLIC),
            new CodeCell(PlanStates.CodeType.CT_BCH155) };
    chooserCode = new JComboBox(codeCells);
    chooserCode.setRenderer(new CodeCellRenderer());
    labelModulation = new JLabel();
    ModulationCell[] modulationCells = { new ModulationCell(PlanStates.ModulationType.MT_ASK),
            new ModulationCell(PlanStates.ModulationType.MT_FSK),
            new ModulationCell(PlanStates.ModulationType.MT_BPSK),
            new ModulationCell(PlanStates.ModulationType.MT_QPSK),
            new ModulationCell(PlanStates.ModulationType.MT_8PSK),
            new ModulationCell(PlanStates.ModulationType.MT_16PSK),
            new ModulationCell(PlanStates.ModulationType.MT_32PSK),
            new ModulationCell(PlanStates.ModulationType.MT_16QAM),
            new ModulationCell(PlanStates.ModulationType.MT_32QAM),
            new ModulationCell(PlanStates.ModulationType.MT_64QAM),
            new ModulationCell(PlanStates.ModulationType.MT_256QAM) };
    chooserModulation = new JComboBox(modulationCells);
    chooserModulation.setRenderer(new ModulationCellRenderer());
    labelChannel = new JLabel();
    ChannelCell[] channelCells = { new ChannelCell(PlanStates.ChannelType.CHT_AWGN),
            new ChannelCell(PlanStates.ChannelType.CHT_RAYLEIGH) };
    chooserChannel = new JComboBox(channelCells);
    chooserChannel.setRenderer(new ChannelCellRenderer());
    buttonClearPlan = new JButton();
    labelErrors = new JLabel();
    ErrorsCell[] errorCells = { new ErrorsCell(PlanStates.ErrorsType.ET_SER),
            new ErrorsCell(PlanStates.ErrorsType.ET_BER) };
    chooserErrors = new JComboBox(errorCells);
    chooserErrors.setRenderer(new ErrorsCellRenderer());
    labelLineWidth = new JLabel();
    spinnerLineWidth = new JSpinner();
    buttonRemoveFromPlan = new JButton();
    labelLineColor = new JLabel();
    ColorCell[] colorCells = { new ColorCell(null), new ColorCell(Color.black), new ColorCell(Color.red),
            new ColorCell(Color.green), new ColorCell(Color.blue) };
    chooserLineColor = new JComboBox(colorCells);
    chooserLineColor.setRenderer(new ColorCellRenderer());
    labelHSquare = new JLabel();
    spinnerHSquareLow = new JSpinner();
    labelEllipsis = new JLabel();
    spinnerHSquareHigh = new JSpinner();
    panelInner1 = new JPanel();
    labelHSquareStep = new JLabel();
    spinnerHSquareStep = new JSpinner();
    labelMeasurementUnit = new JLabel();
    radioButtonMeasurementUnitTimes = new JRadioButton();
    radioButtonMeasurementUnitdB = new JRadioButton();
    buttonRunSimulation = new JButton();
    labelIterations = new JLabel();
    spinnerIterations = new JSpinner();
    checkBoxShowLineNumbers = new JCheckBox();
    tabbedPaneResults = new JTabbedPane();
    panelChart = new JPanel();
    panelNumeric = new JPanel();
    scrollPane2 = new JScrollPane();
    textAreaNumeric = new JTextArea();
    progressBar = new JProgressBar();

    //======== this ========
    setLayout(new FormLayout("3*(default, $lcgap), 36dlu, $lcgap, 122dlu:grow",
            "[21px,default], 9*($lgap, default), $lgap, default:grow, $lgap, default"));

    //======== menuMain ========
    {/*from   w w  w. jav a  2 s.  com*/

        //======== menuFile ========
        {
            menuFile.setText("\u0424\u0430\u0439\u043b");

            //---- menuItemQuit ----
            menuItemQuit.setText("\u0412\u0438\u0439\u0442\u0438");
            menuItemQuit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.CTRL_MASK));
            menuItemQuit.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItemQuitActionPerformed(e);
                }
            });
            menuFile.add(menuItemQuit);
        }
        menuMain.add(menuFile);

        //======== menuTools ========
        {
            menuTools.setText("\u0406\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0438");

            //======== menuConstellations ========
            {
                menuConstellations.setText(
                        "\u0421\u0438\u0433\u043d\u0430\u043b\u044c\u043d\u0456 \u0441\u0443\u0437\u0456\u0440\u2019\u044f");

                //---- menuItemASK ----
                menuItemASK.setText("\u0410\u041c\u043d\u2026");
                menuItemASK.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItemASKActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItemASK);

                //---- menuItemFSK ----
                menuItemFSK.setText("\u0427\u041c\u043d\u2026");
                menuItemFSK.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItemFSKActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItemFSK);

                //---- menuItemBPSK ----
                menuItemBPSK.setText("\u0424\u041c\u043d\u2026");
                menuItemBPSK.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItemBPSKActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItemBPSK);

                //---- menuItemQPSK ----
                menuItemQPSK.setText("\u0424\u041c-4\u2026");
                menuItemQPSK.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItemQPSKActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItemQPSK);

                //---- menuItem8PSK ----
                menuItem8PSK.setText("\u0424\u041c-8\u2026");
                menuItem8PSK.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItem8PSKActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItem8PSK);

                //---- menuItem16PSK ----
                menuItem16PSK.setText("\u0424\u041c-16\u2026");
                menuItem16PSK.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItem16PSKActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItem16PSK);

                //---- menuItem32PSK ----
                menuItem32PSK.setText("\u0424\u041c-32\u2026");
                menuItem32PSK.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItem32PSKActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItem32PSK);

                //---- menuItem16QAM ----
                menuItem16QAM.setText("\u041a\u0410\u041c-16\u2026");
                menuItem16QAM.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItem16QAMActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItem16QAM);

                //---- menuItem32QAM ----
                menuItem32QAM.setText("\u041a\u0410\u041c-32\u2026");
                menuItem32QAM.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItem32QAMActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItem32QAM);

                //---- menuItem64QAM ----
                menuItem64QAM.setText("\u041a\u0410\u041c-64\u2026");
                menuItem64QAM.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItem64QAMActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItem64QAM);

                //---- menuItem256QAM ----
                menuItem256QAM.setText("\u041a\u0410\u041c-256\u2026");
                menuItem256QAM.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItem256QAMActionPerformed(e);
                    }
                });
                menuConstellations.add(menuItem256QAM);
            }
            menuTools.add(menuConstellations);
        }
        menuMain.add(menuTools);

        //======== menuHelp ========
        {
            menuHelp.setText("\u0414\u043e\u0432\u0456\u0434\u043a\u0430");

            //---- menuItemAbout ----
            menuItemAbout.setText("\u041f\u0440\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0443\u2026");
            menuItemAbout.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItemAboutActionPerformed(e);
                }
            });
            menuHelp.add(menuItemAbout);
        }
        menuMain.add(menuHelp);
    }
    add(menuMain, CC.xywh(1, 1, 9, 1, CC.FILL, CC.FILL));

    //---- labelSource ----
    labelSource.setText("\u0414\u0436\u0435\u0440\u0435\u043b\u043e:");
    add(labelSource, CC.xy(1, 3));
    add(chooserSource, CC.xy(3, 3));

    //---- buttonAddToPlan ----
    buttonAddToPlan.setText("\u2192");
    buttonAddToPlan.setToolTipText(
            "\u0414\u043e\u0434\u0430\u0442\u0438 \u0434\u043e \u043f\u043b\u0430\u043d\u0443 \u0435\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0443");
    buttonAddToPlan.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            buttonAddToPlanActionPerformed(e);
        }
    });
    add(buttonAddToPlan, CC.xywh(5, 3, 1, 5));

    //======== panelPlan ========
    {
        panelPlan.setLayout(new GridLayout());

        //======== scrollPane1 ========
        {
            scrollPane1.setViewportView(listPlan);
        }
        panelPlan.add(scrollPane1);
    }
    add(panelPlan, CC.xywh(7, 3, 3, 13));

    //---- labelCode ----
    labelCode.setText("\u041a\u043e\u0434:");
    add(labelCode, CC.xy(1, 5));
    add(chooserCode, CC.xy(3, 5));

    //---- labelModulation ----
    labelModulation.setText("\u041c\u043e\u0434\u0443\u043b\u044f\u0446\u0456\u044f:");
    add(labelModulation, CC.xy(1, 7));
    add(chooserModulation, CC.xy(3, 7));

    //---- labelChannel ----
    labelChannel.setText("\u041a\u0430\u043d\u0430\u043b:");
    add(labelChannel, CC.xy(1, 9));
    add(chooserChannel, CC.xy(3, 9));

    //---- buttonClearPlan ----
    buttonClearPlan.setText("X");
    buttonClearPlan.setToolTipText(
            "\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u043f\u043b\u0430\u043d \u0435\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0443");
    buttonClearPlan.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            buttonClearPlanActionPerformed(e);
        }
    });
    add(buttonClearPlan, CC.xy(5, 9));

    //---- labelErrors ----
    labelErrors.setText("\u041f\u043e\u043c\u0438\u043b\u043a\u0438:");
    add(labelErrors, CC.xy(1, 11));
    add(chooserErrors, CC.xy(3, 11));

    //---- labelLineWidth ----
    labelLineWidth.setText("\u0422\u043e\u0432\u0449\u0438\u043d\u0430 \u043b\u0456\u043d\u0456\u0457:");
    add(labelLineWidth, CC.xy(1, 13));

    //---- spinnerLineWidth ----
    spinnerLineWidth.setModel(new SpinnerNumberModel(2, 1, 5, 1));
    add(spinnerLineWidth, CC.xy(3, 13));

    //---- buttonRemoveFromPlan ----
    buttonRemoveFromPlan.setText("\u2190");
    buttonRemoveFromPlan.setToolTipText(
            "\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0437 \u043f\u043b\u0430\u043d\u0443 \u0435\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0443");
    buttonRemoveFromPlan.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            buttonRemoveFromPlanActionPerformed(e);
        }
    });
    add(buttonRemoveFromPlan, CC.xywh(5, 11, 1, 5));

    //---- labelLineColor ----
    labelLineColor.setText("\u041a\u043e\u043b\u0456\u0440 \u043b\u0456\u043d\u0456\u0457:");
    add(labelLineColor, CC.xy(1, 15));
    add(chooserLineColor, CC.xy(3, 15));

    //---- labelHSquare ----
    labelHSquare.setText("h\u00b2=");
    add(labelHSquare, CC.xy(1, 17));

    //---- spinnerHSquareLow ----
    spinnerHSquareLow.setModel(new SpinnerNumberModel(0.0, null, null, 1.0));
    add(spinnerHSquareLow, CC.xy(3, 17));

    //---- labelEllipsis ----
    labelEllipsis.setText("\u2026");
    add(labelEllipsis, CC.xy(5, 17, CC.CENTER, CC.DEFAULT));

    //---- spinnerHSquareHigh ----
    spinnerHSquareHigh.setModel(new SpinnerNumberModel(15.0, null, null, 1.0));
    add(spinnerHSquareHigh, CC.xy(7, 17));

    //======== panelInner1 ========
    {
        panelInner1.setLayout(new FormLayout("5*(default, $lcgap), default:grow", "default"));

        //---- labelHSquareStep ----
        labelHSquareStep.setText(", \u043a\u0440\u043e\u043a:");
        panelInner1.add(labelHSquareStep, CC.xy(1, 1));

        //---- spinnerHSquareStep ----
        spinnerHSquareStep.setModel(new SpinnerNumberModel(0.5, 0.001, null, 0.1));
        panelInner1.add(spinnerHSquareStep, CC.xy(3, 1));

        //---- labelMeasurementUnit ----
        labelMeasurementUnit.setText(", \u043e\u0434\u0438\u043d\u0438\u0446\u0456:");
        panelInner1.add(labelMeasurementUnit, CC.xy(5, 1));

        //---- radioButtonMeasurementUnitTimes ----
        radioButtonMeasurementUnitTimes.setText("\u0440\u0430\u0437\u0438");
        radioButtonMeasurementUnitTimes.setSelected(true);
        panelInner1.add(radioButtonMeasurementUnitTimes, CC.xy(7, 1, CC.LEFT, CC.DEFAULT));

        //---- radioButtonMeasurementUnitdB ----
        radioButtonMeasurementUnitdB.setText("\u0434\u0411");
        panelInner1.add(radioButtonMeasurementUnitdB, CC.xy(9, 1, CC.LEFT, CC.DEFAULT));

        //---- buttonRunSimulation ----
        buttonRunSimulation.setText("\u0412\u0438\u043a\u043e\u043d\u0430\u0442\u0438");
        buttonRunSimulation.setToolTipText(
                "\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u044e\u0432\u0430\u043d\u043d\u044f");
        buttonRunSimulation.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                buttonRunSimulationActionPerformed(e);
            }
        });
        panelInner1.add(buttonRunSimulation, CC.xy(11, 1, CC.RIGHT, CC.DEFAULT));
    }
    add(panelInner1, CC.xy(9, 17));

    //---- labelIterations ----
    labelIterations.setText("\u0406\u0442\u0435\u0440\u0430\u0446\u0456\u0439:");
    add(labelIterations, CC.xy(1, 19));

    //---- spinnerIterations ----
    spinnerIterations.setModel(new SpinnerNumberModel(200000, 1, null, 50000));
    add(spinnerIterations, CC.xy(3, 19));

    //---- checkBoxShowLineNumbers ----
    checkBoxShowLineNumbers.setText(
            "\u041d\u0443\u043c\u0435\u0440\u0443\u0432\u0430\u0442\u0438 \u0433\u0440\u0430\u0444\u0456\u043a\u0438");
    add(checkBoxShowLineNumbers, CC.xywh(7, 19, 3, 1));

    //======== tabbedPaneResults ========
    {

        //======== panelChart ========
        {
            panelChart.setLayout(new BoxLayout(panelChart, BoxLayout.X_AXIS));
        }
        tabbedPaneResults.addTab("\u0413\u0440\u0430\u0444\u0456\u043a\u0438", panelChart);

        //======== panelNumeric ========
        {
            panelNumeric.setLayout(new FormLayout("default:grow", "default:grow"));

            //======== scrollPane2 ========
            {

                //---- textAreaNumeric ----
                textAreaNumeric.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
                textAreaNumeric.setEditable(false);
                scrollPane2.setViewportView(textAreaNumeric);
            }
            panelNumeric.add(scrollPane2, CC.xy(1, 1, CC.DEFAULT, CC.FILL));
        }
        tabbedPaneResults.addTab("\u0427\u0438\u0441\u043b\u043e\u0432\u0456 \u0434\u0430\u043d\u0456",
                panelNumeric);

    }
    add(tabbedPaneResults, CC.xywh(1, 21, 9, 1, CC.DEFAULT, CC.FILL));
    add(progressBar, CC.xywh(1, 23, 9, 1));

    //---- buttonGroupMeasurementUnit ----
    ButtonGroup buttonGroupMeasurementUnit = new ButtonGroup();
    buttonGroupMeasurementUnit.add(radioButtonMeasurementUnitTimes);
    buttonGroupMeasurementUnit.add(radioButtonMeasurementUnitdB);
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:au.org.ala.delta.editor.DeltaEditor.java

private void buildWindowMenu(JMenu mnuWindow) {
    mnuWindow.removeAll();//  w  w  w  .  j a  v  a 2  s .c o m

    JMenuItem mnuItCascade = new JMenuItem();
    mnuItCascade.setAction(_actionMap.get("cascadeFrames"));
    mnuWindow.add(mnuItCascade);

    JMenuItem mnuItTile = new JMenuItem();
    mnuItTile.setAction(_actionMap.get("tileFrames"));
    mnuWindow.add(mnuItTile);

    JMenuItem mnuItTileHorz = new JMenuItem();
    mnuItTileHorz.setAction(_actionMap.get("tileFramesHorizontally"));
    mnuWindow.add(mnuItTileHorz);

    JMenuItem mnuItArrangeIcons = new JMenuItem();
    mnuItArrangeIcons.setAction(_actionMap.get("arrangeIcons"));
    mnuWindow.add(mnuItArrangeIcons);

    JMenuItem mnuItCloseAll = new JMenuItem();
    mnuItCloseAll.setAction(_actionMap.get("closeAllFrames"));
    mnuWindow.add(mnuItCloseAll);

    mnuWindow.addSeparator();

    JMenuItem mnuItChooseFont = new JMenuItem();
    mnuItChooseFont.setAction(_actionMap.get("chooseFont"));
    mnuWindow.add(mnuItChooseFont);

    mnuWindow.addSeparator();

    JMenu mnuLF = new JMenu();
    mnuLF.setName("mnuLF");
    mnuLF.setText(_resourceMap.getString("mnuLF.text"));
    mnuWindow.add(mnuLF);

    JMenuItem mnuItMetalLF = new JMenuItem();
    mnuItMetalLF.setAction(_actionMap.get("metalLookAndFeel"));
    mnuLF.add(mnuItMetalLF);

    JMenuItem mnuItWindowsLF = new JMenuItem();
    mnuItWindowsLF.setAction(_actionMap.get("systemLookAndFeel"));
    mnuLF.add(mnuItWindowsLF);

    try {
        // Nimbus L&F was added in update java 6 update 10.
        Class.forName("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel").newInstance();
        JMenuItem mnuItNimbusLF = new JMenuItem();
        mnuItNimbusLF.setAction(_actionMap.get("nimbusLookAndFeel"));
        mnuLF.add(mnuItNimbusLF);
    } catch (Exception e) {
        // The Nimbus L&F is not available, no matter.
    }
    mnuWindow.addSeparator();

    int i = 1;
    for (final JInternalFrame frame : _frames) {
        JMenuItem windowItem = new JCheckBoxMenuItem();
        if (i < 10) {
            windowItem.setText(String.format("%d %s", i, frame.getTitle()));
            windowItem.setMnemonic(KeyEvent.VK_1 + (i - 1));
        } else {
            windowItem.setText(frame.getTitle());
        }
        windowItem.setSelected(frame.isSelected());
        windowItem.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                try {
                    frame.setSelected(true);
                } catch (PropertyVetoException e1) {
                }
            }
        });
        mnuWindow.add(windowItem);
        ++i;
    }

}

From source file:com.qawaa.gui.EventWebScanGUI.java

/**
 * //from   www. j  a v  a  2  s  . c o m
 */
private void initGUI() {
    try {
        setSize(900, 600);
        {
            jMenuBar1 = new JMenuBar();
            setJMenuBar(jMenuBar1);
            {
                optionMenus = new JMenu();
                jMenuBar1.add(optionMenus);
                optionMenus.setText(CONTEXT.getMessage("gobal.menu.option", null, Locale.CHINA));
                {
                    exitMenuItem = new JMenuItem();
                    optionMenus.add(exitMenuItem);
                    exitMenuItem.setText(CONTEXT.getMessage("gobal.menu.option.quit", null, Locale.CHINA));
                    exitMenuItem.setMnemonic(KeyEvent.VK_Q);
                    exitMenuItem.setAccelerator(
                            javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_Q, Event.ALT_MASK, false));
                    exitMenuItem.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            windowsClosed();
                        }
                    });
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:fi.hoski.remote.ui.Admin.java

private void menuEvent() {
    JMenu eventMenu = new JMenu();
    TextUtil.populate(eventMenu, "EVENTS");
    menuBar.add(eventMenu);/*from   w  w  w .  j a va 2 s  . c o m*/
    JMenu addEventMenu = new JMenu();
    TextUtil.populate(addEventMenu, "ADD EVENTS");
    eventMenu.add(addEventMenu);
    JMenu editEventMenu = new JMenu();
    TextUtil.populate(editEventMenu, "EDIT EVENTS");
    eventMenu.add(editEventMenu);
    JMenu deleteEventMenu = new JMenu();
    TextUtil.populate(deleteEventMenu, "DELETE EVENTS");
    eventMenu.add(deleteEventMenu);

    int index = 0;
    for (final EventType eventType : EventType.values()) {
        // add
        JMenuItem addItem = new JMenuItem();
        TextUtil.populate(addItem, eventType.name());
        addItem.addActionListener(creators[index++]);
        addEventMenu.add(addItem);
        // edit
        ActionListener editAction = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                Event selected = chooseEvent(eventType, "EDIT SELECTED");
                if (selected != null) {
                    EventEditor editor = new EventEditor(null);
                    editor.edit(selected);
                } else {
                    JOptionPane.showMessageDialog(frame, TextUtil.getText("NO SELECTION"),
                            TextUtil.getText("MESSAGE"), JOptionPane.INFORMATION_MESSAGE);
                }
            }
        };
        editAction = createActionListener(frame, editAction);
        JMenuItem editItem = new JMenuItem();
        TextUtil.populate(editItem, eventType.name());
        editItem.addActionListener(editAction);
        editEventMenu.add(editItem);
        // delete
        ActionListener deleteAction = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                List<Event> selected = chooseEvents(eventType, "DELETE SELECTED");
                if (selected != null && selected.size() >= 1) {
                    if (JOptionPane.showConfirmDialog(panel,
                            TextUtil.getText("CONFIRM DELETE")) == JOptionPane.YES_OPTION) {
                        dss.deleteEvents(selected);
                    }
                } else {
                    JOptionPane.showMessageDialog(frame, TextUtil.getText("NO SELECTION"),
                            TextUtil.getText("MESSAGE"), JOptionPane.INFORMATION_MESSAGE);
                }
            }
        };
        deleteAction = createActionListener(frame, deleteAction);
        JMenuItem deleteItem = new JMenuItem();
        TextUtil.populate(deleteItem, eventType.name());
        deleteItem.addActionListener(deleteAction);
        deleteEventMenu.add(deleteItem);
    }
}