Example usage for javax.swing JMenuBar JMenuBar

List of usage examples for javax.swing JMenuBar JMenuBar

Introduction

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

Prototype

public JMenuBar() 

Source Link

Document

Creates a new menu bar.

Usage

From source file:com.isencia.passerelle.hmi.HMIBase.java

/**
 * Constructs a default menu.// w  w w.  j a va2s .  c  o  m
 * <ul>
 * <li>If the menuItems set is null, all default items are created.
 * <li>If the set is not null, only the menu items whose names are in there
 * are shown
 * </ul>
 * For an overview of the names, check HMIMessages.MENU_...
 * 
 * @param menuItemsToShow
 * @param menuItemsToHide
 * @return
 */
public JMenuBar createDefaultMenu(final Set<String> menuItemsToShow, final Set<String> menuItemsToHide) {
    final JMenuBar menuBar = new JMenuBar();

    final JMenu fileMenu = new JMenu(HMIMessages.getString(HMIMessages.MENU_FILE));
    fileMenu.setMnemonic(HMIMessages.getString(HMIMessages.MENU_FILE + HMIMessages.KEY).charAt(0));

    if (showThing(HMIMessages.MENU_TEMPLATES, menuItemsToShow, menuItemsToHide)) {
        final JMenu templatesSubMenu = new JMenu(HMIMessages.getString(HMIMessages.MENU_TEMPLATES));
        final Iterator itr = hmiModelsDef.getModels().keySet().iterator();

        final List<String> orderedList = new ArrayList<String>();
        while (itr.hasNext()) {
            final String modelKey = (String) itr.next();
            final String labelKey = modelKey; // HMIMessages.getString(modelKey);
            orderedList.add(labelKey);
        }
        Collections.sort(orderedList);

        for (int i = 0; i < orderedList.size(); i++) {
            try {
                // JMenuItem templateMenuItem = new
                // JMenuItem(HMIMessages.getString(HMIMessages.MENU_TEMPLATES)
                // + " " + HMIMessages.getString(modelKey));
                final JMenuItem templateMenuItem = new JMenuItem(HMIMessages.getString(orderedList.get(i)));
                templateMenuItem.addActionListener(new TemplateModelOpener(orderedList.get(i)));
                templatesSubMenu.add(templateMenuItem);
            } catch (final Exception e1) {
                e1.printStackTrace();
                logger.error("", e1);
            }
        }
        fileMenu.add(templatesSubMenu);

        StateMachine.getInstance().registerActionForState(StateMachine.READY, HMIMessages.MENU_TEMPLATES,
                templatesSubMenu);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_OPEN, HMIMessages.MENU_TEMPLATES,
                templatesSubMenu);

    }

    if (showModelGraph) {
        if (showThing(HMIMessages.MENU_NEW, menuItemsToShow, menuItemsToHide)) {
            if (modelCreatorAction == null) {
                modelCreatorAction = new ModelCreator(this);
            }
            fileMenu.add(modelCreatorAction);
            // final JMenuItem fileNewMenuItem = new JMenuItem(HMIMessages
            // .getString(HMIMessages.MENU_NEW), HMIMessages.getString(
            // HMIMessages.MENU_NEW + HMIMessages.KEY).charAt(0));
            // fileNewMenuItem.setAccelerator(KeyStroke.getKeyStroke(
            // KeyEvent.VK_N, InputEvent.CTRL_MASK));
            // fileNewMenuItem.addActionListener(new ModelCreator());
            // fileMenu.add(fileNewMenuItem);

            // StateMachine.getInstance().registerActionForState(
            // StateMachine.READY, HMIMessages.MENU_NEW, fileNewMenuItem);
            // StateMachine.getInstance().registerActionForState(
            // StateMachine.MODEL_OPEN, HMIMessages.MENU_NEW,
            // fileNewMenuItem);
        }
    }

    if (showThing(HMIMessages.MENU_OPEN, menuItemsToShow, menuItemsToHide)) {
        final JMenuItem fileOpenMenuItem = new JMenuItem(HMIMessages.getString(HMIMessages.MENU_OPEN),
                HMIMessages.getString(HMIMessages.MENU_OPEN + HMIMessages.KEY).charAt(0));
        fileOpenMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));
        fileOpenMenuItem.addActionListener(new ModelOpener());
        fileMenu.add(fileOpenMenuItem);

        StateMachine.getInstance().registerActionForState(StateMachine.READY, HMIMessages.MENU_OPEN,
                fileOpenMenuItem);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_OPEN, HMIMessages.MENU_OPEN,
                fileOpenMenuItem);
    }

    if (showThing(HMIMessages.MENU_CLOSE, menuItemsToShow, menuItemsToHide)) {
        final JMenuItem fileCloseMenuItem = new JMenuItem(HMIMessages.getString(HMIMessages.MENU_CLOSE),
                HMIMessages.getString(HMIMessages.MENU_CLOSE + HMIMessages.KEY).charAt(0));
        fileCloseMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));
        fileCloseMenuItem.addActionListener(new ModelCloser());
        fileMenu.add(fileCloseMenuItem);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_OPEN, HMIMessages.MENU_CLOSE,
                fileCloseMenuItem);
    }
    if (showThing(HMIMessages.MENU_SAVE, menuItemsToShow, menuItemsToHide)) {
        fileMenu.add(new JSeparator());
        if (saveAction == null) {
            saveAction = new SaveAction(this);
        }
        fileMenu.add(saveAction);
        // StateMachine.getInstance().registerActionForState(
        // StateMachine.MODEL_OPEN, HMIMessages.MENU_SAVE, save);
    }
    if (showThing(HMIMessages.MENU_SAVEAS, menuItemsToShow, menuItemsToHide)) {
        if (saveAsAction == null) {
            saveAsAction = new SaveAsAction(this);
        }
        fileMenu.add(saveAsAction);
        // StateMachine.getInstance().registerActionForState(
        // StateMachine.MODEL_OPEN, HMIMessages.MENU_SAVEAS, save);
    }
    if (showThing(HMIMessages.MENU_EXIT, menuItemsToShow, menuItemsToHide)) {
        final JMenuItem exitMenuItem = new JMenuItem(HMIMessages.getString(HMIMessages.MENU_EXIT),
                HMIMessages.getString(HMIMessages.MENU_EXIT + HMIMessages.KEY).charAt(0));
        exitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));
        exitMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
                if (logger.isTraceEnabled()) {
                    logger.trace("Exit action - entry"); //$NON-NLS-1$
                }

                logger.info(HMIMessages.getString(HMIMessages.INFO_EXIT));
                // DBA to be validating...
                // Application which use HMIBase needs to call exit
                // treatment before exiting
                exitApplication();

                if (logger.isTraceEnabled()) {
                    logger.trace("Exit action - exit"); //$NON-NLS-1$
                }

                System.exit(0);
            }
        });
        fileMenu.add(new JSeparator());
        fileMenu.add(exitMenuItem);

        StateMachine.getInstance().registerActionForState(StateMachine.READY, HMIMessages.MENU_EXIT,
                exitMenuItem);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_OPEN, HMIMessages.MENU_EXIT,
                exitMenuItem);
    }

    final JMenu runMenu = new JMenu(HMIMessages.getString(HMIMessages.MENU_RUN));
    runMenu.setMnemonic(HMIMessages.getString(HMIMessages.MENU_RUN + HMIMessages.KEY).charAt(0));

    if (showThing(HMIMessages.MENU_EXECUTE, menuItemsToShow, menuItemsToHide)) {
        if (modelExecutor == null) {
            modelExecutor = new ModelExecutor(this);
        }
        final JMenuItem runExecuteMenuItem = new JMenuItem(modelExecutor);
        runMenu.add(runExecuteMenuItem);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_OPEN, HMIMessages.MENU_EXECUTE,
                modelExecutor);
    }
    if (showThing(HMIMessages.MENU_STOP, menuItemsToShow, menuItemsToHide)) {
        if (modelStopper == null) {
            modelStopper = new ModelStopper(this);
        }
        final JMenuItem stopExecuteMenuItem = new JMenuItem(modelStopper);
        runMenu.add(stopExecuteMenuItem);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_EXECUTING, HMIMessages.MENU_STOP,
                modelStopper);
    }
    if (showThing(HMIMessages.MENU_INTERACTIVE_ERRORHANDLING, menuItemsToShow, menuItemsToHide)) {
        final JMenuItem interactiveErrorCtrlMenuItem = new JCheckBoxMenuItem(
                HMIMessages.getString(HMIMessages.MENU_INTERACTIVE_ERRORHANDLING));
        interactiveErrorCtrlMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
                interactiveErrorControl = ((JCheckBoxMenuItem) e.getSource()).getState();
            }

        });
        runMenu.add(new JSeparator());
        runMenu.add(interactiveErrorCtrlMenuItem);
    }

    final JMenu graphMenu = new JMenu(HMIMessages.getString(HMIMessages.MENU_GRAPH));
    graphMenu.setMnemonic(HMIMessages.getString(HMIMessages.MENU_GRAPH + HMIMessages.KEY).charAt(0));

    // if (showThing(HMIMessages.MENU_SHOW, menuItemsToShow,
    // menuItemsToHide)) {
    // JMenuItem graphViewMenuItem = new
    // JCheckBoxMenuItem(HMIMessages.getString(HMIMessages.MENU_SHOW));
    // graphMenu.add(graphViewMenuItem);
    //
    // graphViewMenuItem.addActionListener(new ActionListener() {
    // public void actionPerformed(ActionEvent e) {
    // if (logger.isTraceEnabled()) {
    //                  logger.trace("Graph Show action - entry"); //$NON-NLS-1$
    // }
    // boolean showGraph = ((JCheckBoxMenuItem) e.getSource()).getState();
    // if(showGraph) {
    // applyFieldValuesToParameters();
    // clearModelForms();
    // showModelGraph(HMIBase.this.currentModel.getName());
    // } else {
    // clearModelGraphs();
    // showModelForm(HMIBase.this.currentModel.getName());
    // }
    // if (logger.isTraceEnabled()) {
    //                  logger.trace("Graph Show action - exit"); //$NON-NLS-1$
    // }
    // }
    //
    //
    // });
    // }
    if (showThing(HMIMessages.MENU_ANIMATE, menuItemsToShow, menuItemsToHide)) {
        final JMenuItem animateGraphViewMenuItem = new JCheckBoxMenuItem(
                HMIMessages.getString(HMIMessages.MENU_ANIMATE));
        animateGraphViewMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
                animateModelExecution = ((JCheckBoxMenuItem) e.getSource()).getState();
            }

        });
        graphMenu.add(new JSeparator());
        graphMenu.add(animateGraphViewMenuItem);
    }

    if (fileMenu.getMenuComponentCount() > 0) {
        menuBar.add(fileMenu);
    }
    if (runMenu.getMenuComponentCount() > 0) {
        menuBar.add(runMenu);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_OPEN, HMIMessages.MENU_RUN,
                runMenu);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_EXECUTING, HMIMessages.MENU_RUN,
                runMenu);
    }
    if (graphMenu.getMenuComponentCount() > 0) {
        menuBar.add(graphMenu);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_OPEN, HMIMessages.MENU_GRAPH,
                graphMenu);
        StateMachine.getInstance().registerActionForState(StateMachine.MODEL_EXECUTING, HMIMessages.MENU_GRAPH,
                graphMenu);
    }

    final JMenu monitoringMenu = new JMenu(HMIMessages.getString(HMIMessages.MENU_MONITORING));
    monitoringMenu.setMnemonic(HMIMessages.getString(HMIMessages.MENU_MONITORING + HMIMessages.KEY).charAt(0));
    if (showThing(HMIMessages.MENU_TRACING, menuItemsToShow, menuItemsToHide)) {
        final JMenuItem traceMenuItem = new JMenuItem(HMIMessages.getString(HMIMessages.MENU_TRACING),
                HMIMessages.getString(HMIMessages.MENU_TRACING + HMIMessages.KEY).charAt(0));
        traceMenuItem.addActionListener(new TraceDialogOpener());
        monitoringMenu.add(traceMenuItem);
    }

    if (monitoringMenu.getMenuComponentCount() > 0) {
        menuBar.add(monitoringMenu);
    }

    StateMachine.getInstance().compile();
    StateMachine.getInstance().transitionTo(StateMachine.READY);
    return menuBar;
}

From source file:edu.harvard.mcz.imagecapture.MainFrame.java

/**
 * This method initializes jJMenuBar   //www  .  j  a va  2  s .c  om
 *    
 * @return javax.swing.JMenuBar   
 */
private JMenuBar getJJMenuBar() {
    if (jJMenuBar == null) {
        jJMenuBar = new JMenuBar();
        jJMenuBar.add(getJMenuFile());
        jJMenuBar.add(getJMenuEdit());
        jJMenuBar.add(getJMenuAction());
        jJMenuBar.add(getJMenuData());
        jJMenuBar.add(getJMenuQualityControl());
        jJMenuBar.add(getJMenuConfig());
        jJMenuBar.add(getJMenuHelp());
    }
    return jJMenuBar;
}

From source file:com.opendoorlogistics.studio.AppFrame.java

private void initMenus() {
    final JMenuBar menuBar = new JMenuBar();
    class AddSpace {
        void add() {
            JMenu dummy = new JMenu();
            dummy.setEnabled(false);/*from   ww w  . j  a va  2  s  .co  m*/
            menuBar.add(dummy);
        }
    }
    AddSpace addSpace = new AddSpace();

    // add file menu ... build on the fly for recent files..
    setJMenuBar(menuBar);
    final JMenu mnFile = new JMenu("File");
    mnFile.setMnemonic('F');
    mnFile.addMenuListener(new MenuListener() {

        @Override
        public void menuSelected(MenuEvent e) {
            initFileMenu(mnFile);
        }

        @Override
        public void menuDeselected(MenuEvent e) {
            // TODO Auto-generated method stub

        }

        @Override
        public void menuCanceled(MenuEvent e) {
            // TODO Auto-generated method stub

        }
    });
    initFileMenu(mnFile);
    menuBar.add(mnFile);
    addSpace.add();

    // add edit menu
    JMenu mnEdit = new JMenu("Edit");
    mnEdit.setMnemonic('E');
    menuBar.add(mnEdit);
    addSpace.add();
    for (MyAction action : editActions) {
        JMenuItem item = mnEdit.add(action);
        if (action.accelerator != null) {
            item.setAccelerator(action.accelerator);
        }
    }

    // add run scripts menu (hidden until a datastore is loaded)
    mnScripts = new JMenu("Run script");
    mnScripts.setMnemonic('R');
    mnScripts.setVisible(false);
    mnScripts.addMenuListener(new MenuListener() {

        @Override
        public void menuSelected(MenuEvent e) {
            mnScripts.removeAll();
            for (final ScriptNode item : scriptsPanel.getScripts()) {
                if (item.isAvailable() == false) {
                    continue;
                }
                if (item.isRunnable()) {
                    mnScripts.add(new AbstractAction(item.getDisplayName(), item.getIcon()) {

                        @Override
                        public void actionPerformed(ActionEvent e) {
                            scriptManager.executeScript(item.getFile(), item.getLaunchExecutorId());
                        }
                    });
                } else if (item.getChildCount() > 0) {
                    JMenu popup = new JMenu(item.getDisplayName());
                    mnScripts.add(popup);
                    for (int i = 0; i < item.getChildCount(); i++) {
                        final ScriptNode child = (ScriptNode) item.getChildAt(i);
                        if (child.isRunnable()) {
                            popup.add(new AbstractAction(child.getDisplayName(), child.getIcon()) {

                                @Override
                                public void actionPerformed(ActionEvent e) {
                                    scriptManager.executeScript(child.getFile(), child.getLaunchExecutorId());
                                }
                            });
                        }

                    }
                }
            }
            mnScripts.validate();
        }

        @Override
        public void menuDeselected(MenuEvent e) {
        }

        @Override
        public void menuCanceled(MenuEvent e) {
        }
    });
    menuBar.add(mnScripts);
    addSpace.add();

    // add create script menu
    menuBar.add(initCreateScriptsMenu());
    addSpace.add();

    // add window menu
    JMenu mnWindow = new JMenu("Window");
    mnWindow.setMnemonic('W');
    menuBar.add(mnWindow);
    addSpace.add();
    initWindowMenus(mnWindow);

    menuBar.add(initHelpMenu());

    addSpace.add();

}

From source file:com.googlecode.bpmn_simulator.gui.BPMNSimulatorFrame.java

private JMenuBar createMenuBar() {
    final JMenuBar menubar = new JMenuBar();

    menubar.add(createMenuFile());/*from w  w w  .  j  a v  a  2s.com*/

    menubar.add(createMenuExtra());

    menubar.add(createWindowMenu());

    menubar.add(createMenuHelp());

    return menubar;
}

From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.navegacao_cego.PainelSimuladorNavegacao.java

private JMenuBar criaMenuBar() {
    menuBar = new JMenuBar();

    menuBar.setBackground(parentFrame.corDefault);

    JMenu menuArquivo = new JMenu(GERAL.ARQUIVO);
    menuArquivo.setMnemonic('A');
    menuArquivo.setMnemonic(KeyEvent.VK_A);
    menuArquivo.setBackground(parentFrame.corDefault);

    JMenu avaliadores = new JMenu();
    MenuSilvinha menuSilvinha = new MenuSilvinha(parentFrame, null);
    menuSilvinha.criaMenuAvaliadores(avaliadores);
    // menuArquivo.add(avaliadores);
    // menuArquivo.add(new JSeparator());

    JMenuItem btnAbrir = new JMenuItem(GERAL.BTN_ABRIR);
    btnAbrir.addActionListener(this);
    btnAbrir.setActionCommand("Abrir");
    btnAbrir.setMnemonic('A');
    btnAbrir.setAccelerator(//from  ww w. ja  v a  2  s. co m
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, ActionEvent.CTRL_MASK));
    btnAbrir.setMnemonic(KeyEvent.VK_A);
    btnAbrir.setToolTipText(TradSimuladorNavegacao.DICA_ABRE_E_AVALIA);
    btnAbrir.getAccessibleContext().setAccessibleDescription(TradSimuladorNavegacao.DICA_ABRE_E_AVALIA);
    menuArquivo.add(btnAbrir);

    JMenuItem btnAbrirUrl = new JMenuItem(XHTML_Panel.BTN_ABRIR_URL);
    btnAbrirUrl.addActionListener(this);
    btnAbrirUrl.setActionCommand("AbrirURL");
    btnAbrirUrl.setMnemonic('U');
    btnAbrirUrl.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, ActionEvent.CTRL_MASK));
    btnAbrirUrl.setMnemonic(KeyEvent.VK_U);
    btnAbrirUrl.setToolTipText(XHTML_Panel.DICA_ABRIR);
    btnAbrirUrl.getAccessibleContext().setAccessibleDescription(XHTML_Panel.DICA_ABRIR);
    menuArquivo.add(btnAbrirUrl);

    btnSalvar = new JMenuItem(GERAL.BTN_SALVAR);
    btnSalvar.addActionListener(this);
    btnSalvar.setActionCommand("Salvar");
    btnSalvar.setMnemonic('S');
    btnSalvar.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, ActionEvent.CTRL_MASK));
    btnSalvar.setMnemonic(KeyEvent.VK_S);
    btnSalvar.getAccessibleContext().setAccessibleDescription(TradSimuladorNavegacao.DICA_GRAVA_E_REAVALIA);
    // menuArquivo.add(btnSalvar);

    JMenuItem btnSalvarAs = new JMenuItem(GERAL.BTN_SALVAR_COMO);
    btnSalvarAs.addActionListener(this);
    btnSalvarAs.setActionCommand("SaveAs");
    btnSalvarAs.setMnemonic('c');
    btnSalvarAs.setMnemonic(KeyEvent.VK_C);
    // btnSalvarAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
    // ActionEvent.CTRL_MASK));
    btnSalvarAs.setToolTipText(GERAL.DICA_SALVAR_COMO);
    btnSalvarAs.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVAR_COMO);
    // menuArquivo.add(btnSalvarAs);

    menuArquivo.add(new JSeparator());

    JMenuItem btnFechar = new JMenuItem(GERAL.SAIR);
    //btnFechar.addActionListener(this);
    btnFechar.setActionCommand("Sair");
    //btnFechar.setMnemonic(KeyEvent.VK_X);
    btnFechar.setToolTipText(GERAL.DICA_SAIR);
    //btnFechar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SAIR);
    menuArquivo.add(btnFechar);
    btnFechar.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
    btnFechar.setMnemonic('X');
    btnFechar.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            System.exit(0);
        }
    });

    menuBar.add(menuArquivo);

    menuBar.add(this.criaMenuEditar());

    menuBar.add(avaliadores);

    JMenu menuSimuladores = new JMenu();
    menuSilvinha.criaMenuSimuladores(menuSimuladores);
    menuBar.add(menuSimuladores);

    JMenu mnFerramenta = new JMenu();
    menuSilvinha.criaMenuFerramentas(mnFerramenta);
    menuBar.add(mnFerramenta);

    JMenu menuAjuda = new JMenu(GERAL.AJUDA);
    menuSilvinha.criaMenuAjuda(menuAjuda);
    menuBar.add(menuAjuda);

    return menuBar;
}

From source file:org.eurocarbdb.application.glycoworkbench.plugin.AnnotationReportApplet.java

private JMenuBar createMenuBar() {

    JMenuBar menubar = new JMenuBar();

    menubar.add(createFileMenu());//from   w  ww  .ja v  a2  s.co  m
    menubar.add(createEditMenu());
    menubar.add(createViewMenu());

    return menubar;
}

From source file:edu.ku.brc.specify.toycode.UpdatesApp.java

public JMenuBar createMenus() {
    JMenuBar menuBar = null;//from  ww w  .  j  a  v  a 2s. co m

    /*UIHelper.createMenuItemWithAction(fileMenu, "Open", "O",  "", true, new AbstractAction() //$NON-NLS-1$
    {
    public void actionPerformed(ActionEvent e)
    {
        doOpen();
    }
    });
            
    JMenuItem saveMenuItem = UIHelper.createMenuItemWithAction(fileMenu, "Save", "S", "", true, new AbstractAction() //$NON-NLS-1$
    {
    public void actionPerformed(ActionEvent e)
    {
        doSave();
    }
            
    });
    saveMenuItem.setEnabled(false);
    */

    if (!UIHelper.isMacOS()) {
        menuBar = new JMenuBar();
        JMenu fileMenu = createMenu(menuBar, "File", "F");
        fileMenu.addSeparator();

        UIHelper.createMenuItemWithAction(fileMenu, "Exit", "x", "", true, new AbstractAction() //$NON-NLS-1$
        {
            public void actionPerformed(ActionEvent e) {
                shutdown();
            }
        });
    }

    return menuBar;
}

From source file:net.openbyte.gui.WorkFrame.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Gary Lee
    menuBar1 = new JMenuBar();
    menu2 = new JMenu();
    menuItem8 = new JMenuItem();
    menuItem6 = new JMenuItem();
    menuItem4 = new JMenuItem();
    menuItem5 = new JMenuItem();
    menu3 = new JMenu();
    menuItem7 = new JMenuItem();
    menu6 = new JMenu();
    menuItem11 = new JMenuItem();
    menu1 = new JMenu();
    menuItem1 = new JMenuItem();
    menuItem2 = new JMenuItem();
    menuItem3 = new JMenuItem();
    menu4 = new JMenu();
    menuItem9 = new JMenuItem();
    menu5 = new JMenu();
    menuItem10 = new JMenuItem();
    scrollPane3 = new JScrollPane();
    tree1 = new JTree();
    rTextScrollPane1 = new RTextScrollPane();
    rSyntaxTextArea1 = new RSyntaxTextArea();

    //======== this ========
    setTitle("Project Workspace");
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    Container contentPane = getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));

    //======== menuBar1 ========
    {/* www.java2 s. co m*/

        //======== menu2 ========
        {
            menu2.setText("File");

            //---- menuItem8 ----
            menuItem8.setText("Add Class");
            menuItem8.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem8ActionPerformed(e);
                }
            });
            menu2.add(menuItem8);

            //---- menuItem6 ----
            menuItem6.setText("Add Package");
            menuItem6.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem6ActionPerformed(e);
                }
            });
            menu2.add(menuItem6);

            //---- menuItem4 ----
            menuItem4.setText("Save");
            menuItem4.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem4ActionPerformed(e);
                }
            });
            menu2.add(menuItem4);

            //---- menuItem5 ----
            menuItem5.setText("Close Project");
            menuItem5.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem5ActionPerformed(e);
                }
            });
            menu2.add(menuItem5);
        }
        menuBar1.add(menu2);

        //======== menu3 ========
        {
            menu3.setText("Edit");

            //---- menuItem7 ----
            menuItem7.setText("Delete");
            menuItem7.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem7ActionPerformed(e);
                }
            });
            menu3.add(menuItem7);
        }
        menuBar1.add(menu3);

        //======== menu6 ========
        {
            menu6.setText("View");

            //---- menuItem11 ----
            menuItem11.setText("Output");
            menuItem11.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem11ActionPerformed(e);
                }
            });
            menu6.add(menuItem11);
        }
        menuBar1.add(menu6);

        //======== menu1 ========
        {
            menu1.setText("Gradle");

            //---- menuItem1 ----
            menuItem1.setText("Run Client");
            menuItem1.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem1ActionPerformed(e);
                }
            });
            menu1.add(menuItem1);

            //---- menuItem2 ----
            menuItem2.setText("Run Server");
            menuItem2.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem2ActionPerformed(e);
                }
            });
            menu1.add(menuItem2);

            //---- menuItem3 ----
            menuItem3.setText("Build Mod JAR");
            menuItem3.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem3ActionPerformed(e);
                }
            });
            menu1.add(menuItem3);
        }
        menuBar1.add(menu1);

        //======== menu4 ========
        {
            menu4.setText("Git");

            //---- menuItem9 ----
            menuItem9.setText("Import into Git");
            menuItem9.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    menuItem9ActionPerformed(e);
                    menuItem9ActionPerformed(e);
                }
            });
            menu4.add(menuItem9);

            //======== menu5 ========
            {
                menu5.setText("Options");
                menu5.setEnabled(false);

                //---- menuItem10 ----
                menuItem10.setText("Commit");
                menuItem10.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        menuItem10ActionPerformed(e);
                    }
                });
                menu5.add(menuItem10);
            }
            menu4.add(menu5);
        }
        menuBar1.add(menu4);
    }
    setJMenuBar(menuBar1);

    //======== scrollPane3 ========
    {
        scrollPane3.setBorder(null);

        //---- tree1 ----
        tree1.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "File Manager"));
        tree1.setBackground(new Color(240, 240, 240));
        tree1.setPreferredSize(new Dimension(-600, 85));
        tree1.addTreeSelectionListener(new TreeSelectionListener() {
            @Override
            public void valueChanged(TreeSelectionEvent e) {
                tree1ValueChanged(e);
            }
        });
        scrollPane3.setViewportView(tree1);
    }
    contentPane.add(scrollPane3);

    //======== rTextScrollPane1 ========
    {
        rTextScrollPane1.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "Code Editor"));

        //---- rSyntaxTextArea1 ----
        rSyntaxTextArea1.setSyntaxEditingStyle("text/java");
        rSyntaxTextArea1.setBackground(Color.white);
        rTextScrollPane1.setViewportView(rSyntaxTextArea1);
    }
    contentPane.add(rTextScrollPane1);
    setSize(1230, 785);
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:com.moteiv.trawler.Trawler.java

/**
 * This method initializes mainMenuBar   
 *    /* w  w  w  . j  a  v a  2  s  .com*/
 * @return javax.swing.JMenuBar   
 */
private JMenuBar getMainMenuBar() {
    if (mainMenuBar == null) {
        mainMenuBar = new JMenuBar();
        mainMenuBar.add(getJFileMenu());
        mainMenuBar.add(getJOptionsMenu());
    }
    return mainMenuBar;
}

From source file:br.com.jinsync.view.FrmJInSync.java

/**
 * Initialize the contents of the frame.
 *///from w  w w  .  ja  v  a 2 s  .co  m
private void initialize() {

    Language.loadParameters();

    setBounds(100, 100, 1136, 665);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    GridBagLayout gridBagLayout = new GridBagLayout();
    gridBagLayout.columnWidths = new int[] { 0, 0 };
    gridBagLayout.rowHeights = new int[] { 600, 53, 0, 0 };
    gridBagLayout.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gridBagLayout.rowWeights = new double[] { 1.0, 0.0, 0.0, Double.MIN_VALUE };
    getContentPane().setLayout(gridBagLayout);

    grpFontes = new JTabbedPane(SwingConstants.TOP);
    GridBagConstraints gbc_grpFontes = new GridBagConstraints();
    gbc_grpFontes.insets = new Insets(0, 0, 5, 0);
    gbc_grpFontes.fill = GridBagConstraints.BOTH;
    gbc_grpFontes.gridx = 0;
    gbc_grpFontes.gridy = 0;
    getContentPane().add(grpFontes, gbc_grpFontes);

    tabCopybook = new JPanel();
    tabCopybook.setBackground(Color.WHITE);
    grpFontes.addTab(Language.tabCopy, null, tabCopybook, null);

    GridBagLayout gbl_tabCopybook = new GridBagLayout();
    gbl_tabCopybook.columnWidths = new int[] { 10, 1, 0, 349, 0, 0, 62, 28, 71, 0, 0, 0 };
    gbl_tabCopybook.rowHeights = new int[] { 1, 0, 0, 0 };
    gbl_tabCopybook.columnWeights = new double[] { 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            Double.MIN_VALUE };
    gbl_tabCopybook.rowWeights = new double[] { 0.0, 0.0, 1.0, Double.MIN_VALUE };
    tabCopybook.setLayout(gbl_tabCopybook);

    JLabel lblCopybook = new JLabel(Language.txtFilePds);
    GridBagConstraints gbc_lblCopybook = new GridBagConstraints();
    gbc_lblCopybook.anchor = GridBagConstraints.EAST;
    gbc_lblCopybook.insets = new Insets(0, 0, 5, 5);
    gbc_lblCopybook.gridx = 1;
    gbc_lblCopybook.gridy = 1;
    tabCopybook.add(lblCopybook, gbc_lblCopybook);

    txtPath = new JTextField();
    GridBagConstraints gbc_txtPath = new GridBagConstraints();
    gbc_txtPath.gridwidth = 4;
    gbc_txtPath.insets = new Insets(0, 0, 5, 5);
    gbc_txtPath.fill = GridBagConstraints.HORIZONTAL;
    gbc_txtPath.gridx = 2;
    gbc_txtPath.gridy = 1;
    tabCopybook.add(txtPath, gbc_txtPath);
    txtPath.setColumns(10);

    JButton btnDiretorio = new JButton("");
    btnDiretorio.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/folder.png")));
    btnDiretorio.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            openDirectory();
        }
    });
    GridBagConstraints gbc_btnDiretorio = new GridBagConstraints();
    gbc_btnDiretorio.insets = new Insets(0, 0, 5, 5);
    gbc_btnDiretorio.gridx = 6;
    gbc_btnDiretorio.gridy = 1;
    tabCopybook.add(btnDiretorio, gbc_btnDiretorio);

    btnClearCopy = new JButton("");
    btnClearCopy.setEnabled(false);
    btnClearCopy.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            tableCopy = new JTable();
            scrCopy.setViewportView(tableCopy);
            tableString = new JTable();
            scrTableString.setViewportView(tableString);

            btnExcelString.setEnabled(false);
            btnClearString.setEnabled(false);
            textAreaString.setText("");

            console.removeAllElements();
            btnExcel.setEnabled(false);
            btnClearCopy.setEnabled(false);
            grpFontes.setEnabledAt(1, false);

            tableFile = new JTable();
            scrFile.setViewportView(tableFile);
            btnExcelFile.setEnabled(false);
            btnClearFile.setEnabled(false);
            grpFontes.setEnabledAt(2, false);

        }
    });
    btnClearCopy.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/cancel.png")));
    GridBagConstraints gbc_btnLimpar = new GridBagConstraints();
    gbc_btnLimpar.fill = GridBagConstraints.BOTH;
    gbc_btnLimpar.insets = new Insets(0, 0, 5, 5);
    gbc_btnLimpar.gridx = 9;
    gbc_btnLimpar.gridy = 1;
    tabCopybook.add(btnClearCopy, gbc_btnLimpar);

    JButton btnProcessarBook = new JButton("");
    btnProcessarBook.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            loadData();
            btnClearCopy.setEnabled(true);
            grpFontes.setEnabledAt(1, true);
            grpFontes.setEnabledAt(2, true);
        }
    });
    btnProcessarBook.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/engine.png")));
    GridBagConstraints gbc_btnProcessarBook = new GridBagConstraints();
    gbc_btnProcessarBook.fill = GridBagConstraints.VERTICAL;
    gbc_btnProcessarBook.insets = new Insets(0, 0, 5, 5);
    gbc_btnProcessarBook.gridx = 7;
    gbc_btnProcessarBook.gridy = 1;
    tabCopybook.add(btnProcessarBook, gbc_btnProcessarBook);

    btnExcel = new JButton("");
    btnExcel.setEnabled(false);
    btnExcel.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            expExcelBook();
            // exportarExcelBook(tableCopy, txtPath.getText(),
            // "Horizontal");
        }
    });
    btnExcel.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/excel.png")));
    GridBagConstraints gbc_btnExcel = new GridBagConstraints();
    gbc_btnExcel.insets = new Insets(0, 0, 5, 5);
    gbc_btnExcel.gridx = 8;
    gbc_btnExcel.gridy = 1;
    tabCopybook.add(btnExcel, gbc_btnExcel);

    // JScrollPane scrCopy = new JScrollPane();
    gbc_scrCopy = new GridBagConstraints();
    gbc_scrCopy.gridwidth = 9;
    gbc_scrCopy.insets = new Insets(0, 0, 0, 5);
    gbc_scrCopy.fill = GridBagConstraints.BOTH;
    gbc_scrCopy.gridx = 1;
    gbc_scrCopy.gridy = 2;
    // tabCopybook.add(scrCopy, gbc_scrCopy);

    panelConsole = new Panel();
    GridBagConstraints gbc_panelConsole = new GridBagConstraints();
    gbc_panelConsole.insets = new Insets(0, 0, 5, 0);
    gbc_panelConsole.fill = GridBagConstraints.BOTH;
    gbc_panelConsole.gridx = 0;
    gbc_panelConsole.gridy = 1;
    getContentPane().add(panelConsole, gbc_panelConsole);
    panelConsole.setLayout(new BorderLayout(0, 0));

    listTerminal = new JList<String>();
    listTerminal.setFont(new Font("Courier New", Font.PLAIN, 11));
    listTerminal.setModel(console);

    scrConsole = new JScrollPane(listTerminal);
    panelConsole.add(scrConsole);

    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);

    JMenu mnNewMenu = new JMenu(Language.menuParam);
    menuBar.add(mnNewMenu);

    JMenuItem mnItemUsuario = new JMenuItem(Language.menuParamUser);
    mnItemUsuario.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            FrmUser frmUsuar = new FrmUser();
            frmUsuar.setLocationRelativeTo(null);
            frmUsuar.setVisible(true);
            setUser();
        }
    });
    mnNewMenu.add(mnItemUsuario);

    JMenuItem mnItemFtp = new JMenuItem(Language.menuParamFtp);
    mnItemFtp.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            FrmFtp frmFtp = new FrmFtp();
            frmFtp.setLocationRelativeTo(null);
            frmFtp.setVisible(true);
            setFtp();
        }
    });

    mnNewMenu.add(mnItemFtp);

    JMenu mnAjuda = new JMenu(Language.menuHelp);
    menuBar.add(mnAjuda);

    JMenuItem mntmNewMenuItem = new JMenuItem(Language.menuHelpAbout);
    mntmNewMenuItem.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            FrmAbout frmSobre = new FrmAbout();
            frmSobre.setLocationRelativeTo(null);
            frmSobre.setVisible(true);
        }
    });
    mnAjuda.add(mntmNewMenuItem);

    tabCopybook.setFont(new Font("Arial", Font.PLAIN, 12));
    tabCopybook.add(scrCopy, gbc_scrCopy);

    tabString = new JPanel();
    tabString.setFont(new Font("Arial", Font.PLAIN, 12));
    tabString.setBackground(Color.WHITE);
    grpFontes.addTab(Language.tabString, null, tabString, null);
    grpFontes.setEnabledAt(1, false);
    GridBagLayout gbl_tabString = new GridBagLayout();
    gbl_tabString.columnWidths = new int[] { 10, 1, 346, 349, 0, 0, 62, 28, 71, 0, 0, 0 };
    gbl_tabString.rowHeights = new int[] { 1, 0, 0, 17, 22, 0, 259, 0 };
    gbl_tabString.columnWeights = new double[] { 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            Double.MIN_VALUE };
    gbl_tabString.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE };
    tabString.setLayout(gbl_tabString);

    JLabel lblString = new JLabel("String:");
    GridBagConstraints gbc_lblString = new GridBagConstraints();
    gbc_lblString.anchor = GridBagConstraints.WEST;
    gbc_lblString.insets = new Insets(0, 0, 5, 5);
    gbc_lblString.gridx = 1;
    gbc_lblString.gridy = 1;
    tabString.add(lblString, gbc_lblString);

    textAreaString = new JTextArea();

    JScrollPane scrStringData = new JScrollPane(textAreaString);
    GridBagConstraints gbc_scrString = new GridBagConstraints();
    gbc_scrString.gridheight = 3;
    gbc_scrString.gridwidth = 8;
    gbc_scrString.insets = new Insets(0, 0, 5, 5);
    gbc_scrString.fill = GridBagConstraints.BOTH;
    gbc_scrString.gridx = 1;
    gbc_scrString.gridy = 2;
    tabString.add(scrStringData, gbc_scrString);

    btnClearString = new JButton("");
    btnClearString.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            scrTableString.setViewportView(tableString);
            btnExcelString.setEnabled(false);
            btnClearString.setEnabled(false);
            textAreaString.setText("");
            tableString = new JTable();
            scrTableString.setViewportView(tableString);
        }
    });

    btnExcelString = new JButton("");
    btnExcelString.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            expExcelString();
        }
    });

    JButton btnProcessarArq = new JButton("");
    btnProcessarArq.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            processString();
        }
    });
    btnProcessarArq.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/engine.png")));
    GridBagConstraints gbc_btnProcessarArq = new GridBagConstraints();
    gbc_btnProcessarArq.fill = GridBagConstraints.VERTICAL;
    gbc_btnProcessarArq.insets = new Insets(0, 0, 5, 5);
    gbc_btnProcessarArq.gridx = 9;
    gbc_btnProcessarArq.gridy = 2;
    tabString.add(btnProcessarArq, gbc_btnProcessarArq);
    btnExcelString.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/excel.png")));
    btnExcelString.setEnabled(false);
    GridBagConstraints gbc_btnExcelString = new GridBagConstraints();
    gbc_btnExcelString.fill = GridBagConstraints.VERTICAL;
    gbc_btnExcelString.insets = new Insets(0, 0, 5, 5);
    gbc_btnExcelString.gridx = 9;
    gbc_btnExcelString.gridy = 3;
    tabString.add(btnExcelString, gbc_btnExcelString);
    btnClearString.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/cancel.png")));
    btnClearString.setEnabled(false);
    GridBagConstraints gbc_btnClearString = new GridBagConstraints();
    gbc_btnClearString.fill = GridBagConstraints.VERTICAL;
    gbc_btnClearString.insets = new Insets(0, 0, 5, 5);
    gbc_btnClearString.gridx = 9;
    gbc_btnClearString.gridy = 4;
    tabString.add(btnClearString, gbc_btnClearString);

    JLabel lblSaida = new JLabel(Language.txtOutput);
    GridBagConstraints gbc_lblSaida = new GridBagConstraints();
    gbc_lblSaida.insets = new Insets(0, 0, 5, 5);
    gbc_lblSaida.gridx = 1;
    gbc_lblSaida.gridy = 5;
    tabString.add(lblSaida, gbc_lblSaida);

    GridBagConstraints gbc_scrArquivo = new GridBagConstraints();
    gbc_scrArquivo.fill = GridBagConstraints.BOTH;
    gbc_scrArquivo.gridwidth = 9;
    gbc_scrArquivo.insets = new Insets(0, 0, 0, 5);
    gbc_scrArquivo.gridx = 1;
    gbc_scrArquivo.gridy = 6;
    tabString.add(scrTableString, gbc_scrArquivo);

    tabFile = new JPanel();
    tabFile.addKeyListener(new KeyListener() {

        @Override
        public void keyPressed(KeyEvent e) {
            // TODO Auto-generated method stub
            if (isProcessStarted) {
                int key = e.getKeyCode();
                if (key == KeyEvent.VK_ESCAPE) {
                    int opc = JOptionPane.showConfirmDialog(null, Language.msgCancelProcess, Language.msgInf,
                            JOptionPane.OK_CANCEL_OPTION);
                    if (opc == JOptionPane.OK_OPTION) {
                        escProcessFile();
                    }
                }
            }

        }

        @Override
        public void keyReleased(KeyEvent arg0) {
            // TODO Auto-generated method stub

        }

        @Override
        public void keyTyped(KeyEvent arg0) {
            // TODO Auto-generated method stub

        }

    });

    tabFile.setFont(new Font("Arial", Font.PLAIN, 12));
    tabFile.setBackground(Color.WHITE);
    grpFontes.addTab(Language.tabFile, null, tabFile, null);
    grpFontes.setEnabledAt(2, false);
    GridBagLayout gbl_tabFile = new GridBagLayout();
    gbl_tabFile.columnWidths = new int[] { 10, 1, 49, 459, 0, 0, 62, 28, 0, 71, 0, 0, 0, 0 };
    gbl_tabFile.rowHeights = new int[] { 1, 0, 0, 17, 22, 0, 259, 0, 0 };
    gbl_tabFile.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            Double.MIN_VALUE };
    gbl_tabFile.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE };
    tabFile.setLayout(gbl_tabFile);

    JLabel lblFile = new JLabel(Language.txtFilePds);
    GridBagConstraints gbc_lblFile = new GridBagConstraints();
    gbc_lblFile.anchor = GridBagConstraints.EAST;
    gbc_lblFile.insets = new Insets(0, 0, 5, 5);
    gbc_lblFile.gridx = 1;
    gbc_lblFile.gridy = 1;
    tabFile.add(lblFile, gbc_lblFile);

    txtFile = new JTextField();
    txtFile.setColumns(10);
    GridBagConstraints gbc_txtFile = new GridBagConstraints();
    gbc_txtFile.gridwidth = 5;
    gbc_txtFile.insets = new Insets(0, 0, 5, 5);
    gbc_txtFile.fill = GridBagConstraints.HORIZONTAL;
    gbc_txtFile.gridx = 2;
    gbc_txtFile.gridy = 1;
    tabFile.add(txtFile, gbc_txtFile);

    btnClearFile = new JButton("");
    btnClearFile.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {

            tableFile = new JTable();
            scrFile.setViewportView(tableFile);
            btnExcelFile.setEnabled(false);
            btnClearFile.setEnabled(false);
            progressBar.setStringPainted(true);
            progressBar.setValue(0);
            progressBar.setString("");

        }
    });

    btnExcelFile = new JButton("");
    btnExcelFile.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            expExcelFile();
        }
    });

    btnProcFile = new JButton("");
    btnProcFile.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            loadFile();
        }
    });

    btnDirFile = new JButton("");
    btnDirFile.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            openDirFile();
        }
    });
    btnDirFile.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/folder.png")));
    GridBagConstraints gbc_btnDirFile = new GridBagConstraints();
    gbc_btnDirFile.fill = GridBagConstraints.VERTICAL;
    gbc_btnDirFile.insets = new Insets(0, 0, 5, 5);
    gbc_btnDirFile.gridx = 7;
    gbc_btnDirFile.gridy = 1;
    tabFile.add(btnDirFile, gbc_btnDirFile);
    btnProcFile.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/engine.png")));
    GridBagConstraints gbc_btnProcFile = new GridBagConstraints();
    gbc_btnProcFile.fill = GridBagConstraints.VERTICAL;
    gbc_btnProcFile.insets = new Insets(0, 0, 5, 5);
    gbc_btnProcFile.gridx = 8;
    gbc_btnProcFile.gridy = 1;
    tabFile.add(btnProcFile, gbc_btnProcFile);
    btnExcelFile.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/excel.png")));
    btnExcelFile.setEnabled(false);
    GridBagConstraints gbc_btnExcelFile = new GridBagConstraints();
    gbc_btnExcelFile.insets = new Insets(0, 0, 5, 5);
    gbc_btnExcelFile.gridx = 9;
    gbc_btnExcelFile.gridy = 1;
    tabFile.add(btnExcelFile, gbc_btnExcelFile);
    btnClearFile.setIcon(new ImageIcon(FrmJInSync.class.getResource("/resources/cancel.png")));
    btnClearFile.setEnabled(false);
    GridBagConstraints gbc_btnLimparFile = new GridBagConstraints();
    gbc_btnLimparFile.fill = GridBagConstraints.VERTICAL;
    gbc_btnLimparFile.insets = new Insets(0, 0, 5, 5);
    gbc_btnLimparFile.gridx = 10;
    gbc_btnLimparFile.gridy = 1;
    tabFile.add(btnClearFile, gbc_btnLimparFile);

    JLabel lblTamanho = new JLabel(Language.txtFileLength);
    GridBagConstraints gbc_lblTamanho = new GridBagConstraints();
    gbc_lblTamanho.anchor = GridBagConstraints.WEST;
    gbc_lblTamanho.insets = new Insets(0, 0, 5, 5);
    gbc_lblTamanho.gridx = 1;
    gbc_lblTamanho.gridy = 2;
    tabFile.add(lblTamanho, gbc_lblTamanho);

    txtLength = new JTextField();
    GridBagConstraints gbc_txtTamanho = new GridBagConstraints();
    gbc_txtTamanho.fill = GridBagConstraints.HORIZONTAL;
    gbc_txtTamanho.insets = new Insets(0, 0, 5, 5);
    gbc_txtTamanho.gridx = 2;
    gbc_txtTamanho.gridy = 2;
    tabFile.add(txtLength, gbc_txtTamanho);
    txtLength.setColumns(10);

    JLabel label_1 = new JLabel(Language.txtOutput);
    GridBagConstraints gbc_label_1 = new GridBagConstraints();
    gbc_label_1.anchor = GridBagConstraints.WEST;
    gbc_label_1.insets = new Insets(0, 0, 5, 5);
    gbc_label_1.gridx = 1;
    gbc_label_1.gridy = 3;
    tabFile.add(label_1, gbc_label_1);

    GridBagConstraints gbc_scrFile = new GridBagConstraints();
    gbc_scrFile.gridheight = 3;
    gbc_scrFile.fill = GridBagConstraints.BOTH;
    gbc_scrFile.gridwidth = 10;
    gbc_scrFile.insets = new Insets(0, 0, 5, 5);
    gbc_scrFile.gridx = 1;
    gbc_scrFile.gridy = 4;
    tabFile.add(scrFile, gbc_scrFile);

    progressBar = new JProgressBar();
    GridBagConstraints gbc_progressBar = new GridBagConstraints();
    gbc_progressBar.fill = GridBagConstraints.HORIZONTAL;
    gbc_progressBar.gridwidth = 10;
    gbc_progressBar.insets = new Insets(0, 0, 0, 5);
    gbc_progressBar.gridx = 1;
    gbc_progressBar.gridy = 7;
    tabFile.add(progressBar, gbc_progressBar);

    JLabel lblNewLabel = new JLabel(Language.txtDeveloped + " Rodrigo Augusto Silva dos Santos - 2016");
    GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
    gbc_lblNewLabel.gridx = 0;
    gbc_lblNewLabel.gridy = 2;
    getContentPane().add(lblNewLabel, gbc_lblNewLabel);

    loadParameters();

}