Example usage for javax.swing KeyStroke getKeyStroke

List of usage examples for javax.swing KeyStroke getKeyStroke

Introduction

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

Prototype

public static KeyStroke getKeyStroke(int keyCode, int modifiers) 

Source Link

Document

Returns a shared instance of a KeyStroke, given a numeric key code and a set of modifiers.

Usage

From source file:com.nikonhacker.gui.EmulatorUI.java

@SuppressWarnings("MagicConstant")
protected JMenuBar createMenuBar() {
    JMenuBar menuBar = new JMenuBar();
    JMenuItem tmpMenuItem;/*from  w  ww. ja  v  a2 s  . co  m*/

    //Set up the file menu.
    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);
    menuBar.add(fileMenu);

    //load image
    for (int chip = 0; chip < 2; chip++) {
        loadMenuItem[chip] = new JMenuItem("Load " + Constants.CHIP_LABEL[chip] + " firmware image");
        if (chip == Constants.CHIP_FR)
            loadMenuItem[chip].setMnemonic(KEY_EVENT_LOAD);
        loadMenuItem[chip].setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_LOAD, KEY_CHIP_MODIFIER[chip]));
        loadMenuItem[chip].setActionCommand(COMMAND_IMAGE_LOAD[chip]);
        loadMenuItem[chip].addActionListener(this);
        fileMenu.add(loadMenuItem[chip]);
    }

    fileMenu.add(new JSeparator());

    //decoder
    tmpMenuItem = new JMenuItem("Decode firmware");
    tmpMenuItem.setMnemonic(KeyEvent.VK_D);
    tmpMenuItem.setActionCommand(COMMAND_DECODE);
    tmpMenuItem.addActionListener(this);
    fileMenu.add(tmpMenuItem);

    //encoder
    tmpMenuItem = new JMenuItem("Encode firmware (alpha)");
    tmpMenuItem.setMnemonic(KeyEvent.VK_E);
    tmpMenuItem.setActionCommand(COMMAND_ENCODE);
    tmpMenuItem.addActionListener(this);
    //        fileMenu.add(tmpMenuItem);

    fileMenu.add(new JSeparator());

    //decoder
    tmpMenuItem = new JMenuItem("Decode lens correction data");
    //tmpMenuItem.setMnemonic(KeyEvent.VK_D);
    tmpMenuItem.setActionCommand(COMMAND_DECODE_NKLD);
    tmpMenuItem.addActionListener(this);
    fileMenu.add(tmpMenuItem);

    fileMenu.add(new JSeparator());

    //Save state
    tmpMenuItem = new JMenuItem("Save state");
    tmpMenuItem.setActionCommand(COMMAND_SAVE_STATE);
    tmpMenuItem.addActionListener(this);
    fileMenu.add(tmpMenuItem);

    //Load state
    tmpMenuItem = new JMenuItem("Load state");
    tmpMenuItem.setActionCommand(COMMAND_LOAD_STATE);
    tmpMenuItem.addActionListener(this);
    fileMenu.add(tmpMenuItem);

    fileMenu.add(new JSeparator());

    //quit
    tmpMenuItem = new JMenuItem("Quit");
    tmpMenuItem.setMnemonic(KEY_EVENT_QUIT);
    tmpMenuItem.setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_QUIT, ActionEvent.ALT_MASK));
    tmpMenuItem.setActionCommand(COMMAND_QUIT);
    tmpMenuItem.addActionListener(this);
    fileMenu.add(tmpMenuItem);

    //Set up the run menu.
    JMenu runMenu = new JMenu("Run");
    runMenu.setMnemonic(KeyEvent.VK_R);
    menuBar.add(runMenu);

    for (int chip = 0; chip < 2; chip++) {
        //emulator play
        playMenuItem[chip] = new JMenuItem("Start (or resume) " + Constants.CHIP_LABEL[chip] + " emulator");
        playMenuItem[chip].setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_RUN[chip], ActionEvent.ALT_MASK));
        playMenuItem[chip].setActionCommand(COMMAND_EMULATOR_PLAY[chip]);
        playMenuItem[chip].addActionListener(this);
        runMenu.add(playMenuItem[chip]);

        //emulator debug
        debugMenuItem[chip] = new JMenuItem("Debug " + Constants.CHIP_LABEL[chip] + " emulator");
        debugMenuItem[chip].setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_DEBUG[chip], ActionEvent.ALT_MASK));
        debugMenuItem[chip].setActionCommand(COMMAND_EMULATOR_DEBUG[chip]);
        debugMenuItem[chip].addActionListener(this);
        runMenu.add(debugMenuItem[chip]);

        //emulator pause
        pauseMenuItem[chip] = new JMenuItem("Pause " + Constants.CHIP_LABEL[chip] + " emulator");
        pauseMenuItem[chip].setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_PAUSE[chip], ActionEvent.ALT_MASK));
        pauseMenuItem[chip].setActionCommand(COMMAND_EMULATOR_PAUSE[chip]);
        pauseMenuItem[chip].addActionListener(this);
        runMenu.add(pauseMenuItem[chip]);

        //emulator step
        stepMenuItem[chip] = new JMenuItem("Step " + Constants.CHIP_LABEL[chip] + " emulator");
        stepMenuItem[chip].setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_STEP[chip], ActionEvent.ALT_MASK));
        stepMenuItem[chip].setActionCommand(COMMAND_EMULATOR_STEP[chip]);
        stepMenuItem[chip].addActionListener(this);
        runMenu.add(stepMenuItem[chip]);

        //emulator stop
        stopMenuItem[chip] = new JMenuItem("Stop and reset " + Constants.CHIP_LABEL[chip] + " emulator");
        stopMenuItem[chip].setActionCommand(COMMAND_EMULATOR_STOP[chip]);
        stopMenuItem[chip].addActionListener(this);
        runMenu.add(stopMenuItem[chip]);

        runMenu.add(new JSeparator());

        //setup breakpoints
        breakpointMenuItem[chip] = new JMenuItem("Setup " + Constants.CHIP_LABEL[chip] + " breakpoints");
        breakpointMenuItem[chip].setActionCommand(COMMAND_SETUP_BREAKPOINTS[chip]);
        breakpointMenuItem[chip].addActionListener(this);
        runMenu.add(breakpointMenuItem[chip]);

        if (chip == Constants.CHIP_FR) {
            runMenu.add(new JSeparator());
        }
    }

    //Set up the components menu.
    JMenu componentsMenu = new JMenu("Components");
    componentsMenu.setMnemonic(KeyEvent.VK_O);
    menuBar.add(componentsMenu);

    for (int chip = 0; chip < 2; chip++) {
        //CPU state
        cpuStateMenuItem[chip] = new JCheckBoxMenuItem(Constants.CHIP_LABEL[chip] + " CPU State window");
        if (chip == Constants.CHIP_FR)
            cpuStateMenuItem[chip].setMnemonic(KEY_EVENT_CPUSTATE);
        cpuStateMenuItem[chip]
                .setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_CPUSTATE, KEY_CHIP_MODIFIER[chip]));
        cpuStateMenuItem[chip].setActionCommand(COMMAND_TOGGLE_CPUSTATE_WINDOW[chip]);
        cpuStateMenuItem[chip].addActionListener(this);
        componentsMenu.add(cpuStateMenuItem[chip]);

        //memory hex editor
        memoryHexEditorMenuItem[chip] = new JCheckBoxMenuItem(
                Constants.CHIP_LABEL[chip] + " Memory hex editor");
        if (chip == Constants.CHIP_FR)
            memoryHexEditorMenuItem[chip].setMnemonic(KEY_EVENT_MEMORY);
        memoryHexEditorMenuItem[chip]
                .setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_MEMORY, KEY_CHIP_MODIFIER[chip]));
        memoryHexEditorMenuItem[chip].setActionCommand(COMMAND_TOGGLE_MEMORY_HEX_EDITOR[chip]);
        memoryHexEditorMenuItem[chip].addActionListener(this);
        componentsMenu.add(memoryHexEditorMenuItem[chip]);

        //Interrupt controller
        interruptControllerMenuItem[chip] = new JCheckBoxMenuItem(
                Constants.CHIP_LABEL[chip] + " interrupt controller");
        interruptControllerMenuItem[chip].setActionCommand(COMMAND_TOGGLE_INTERRUPT_CONTROLLER_WINDOW[chip]);
        interruptControllerMenuItem[chip].addActionListener(this);
        componentsMenu.add(interruptControllerMenuItem[chip]);

        //Programmble timers
        programmableTimersMenuItem[chip] = new JCheckBoxMenuItem(
                Constants.CHIP_LABEL[chip] + " programmable timers");
        programmableTimersMenuItem[chip].setActionCommand(COMMAND_TOGGLE_PROGRAMMABLE_TIMERS_WINDOW[chip]);
        programmableTimersMenuItem[chip].addActionListener(this);
        componentsMenu.add(programmableTimersMenuItem[chip]);

        //Serial interface
        serialInterfacesMenuItem[chip] = new JCheckBoxMenuItem(
                Constants.CHIP_LABEL[chip] + " serial interfaces");
        serialInterfacesMenuItem[chip].setActionCommand(COMMAND_TOGGLE_SERIAL_INTERFACES[chip]);
        serialInterfacesMenuItem[chip].addActionListener(this);
        componentsMenu.add(serialInterfacesMenuItem[chip]);

        // I/O
        ioPortsMenuItem[chip] = new JCheckBoxMenuItem(Constants.CHIP_LABEL[chip] + " I/O ports");
        ioPortsMenuItem[chip].setActionCommand(COMMAND_TOGGLE_IO_PORTS_WINDOW[chip]);
        ioPortsMenuItem[chip].addActionListener(this);
        componentsMenu.add(ioPortsMenuItem[chip]);

        //Serial devices
        serialDevicesMenuItem[chip] = new JCheckBoxMenuItem(Constants.CHIP_LABEL[chip] + " serial devices");
        serialDevicesMenuItem[chip].setActionCommand(COMMAND_TOGGLE_SERIAL_DEVICES[chip]);
        serialDevicesMenuItem[chip].addActionListener(this);
        componentsMenu.add(serialDevicesMenuItem[chip]);

        componentsMenu.add(new JSeparator());
    }

    //screen emulator: FR80 only
    screenEmulatorMenuItem = new JCheckBoxMenuItem("Screen emulator (FR only)");
    screenEmulatorMenuItem.setMnemonic(KEY_EVENT_SCREEN);
    screenEmulatorMenuItem.setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_SCREEN, ActionEvent.ALT_MASK));
    screenEmulatorMenuItem.setActionCommand(COMMAND_TOGGLE_SCREEN_EMULATOR);
    screenEmulatorMenuItem.addActionListener(this);
    componentsMenu.add(screenEmulatorMenuItem);

    //Component 4006: FR80 only
    component4006MenuItem = new JCheckBoxMenuItem("Component 4006 window (FR only)");
    component4006MenuItem.setMnemonic(KeyEvent.VK_4);
    component4006MenuItem.setActionCommand(COMMAND_TOGGLE_COMPONENT_4006_WINDOW);
    component4006MenuItem.addActionListener(this);
    componentsMenu.add(component4006MenuItem);

    componentsMenu.add(new JSeparator());

    //A/D converter: TX19 only for now
    adConverterMenuItem[Constants.CHIP_TX] = new JCheckBoxMenuItem(
            Constants.CHIP_LABEL[Constants.CHIP_TX] + " A/D converter (TX only)");
    adConverterMenuItem[Constants.CHIP_TX].setActionCommand(COMMAND_TOGGLE_AD_CONVERTER[Constants.CHIP_TX]);
    adConverterMenuItem[Constants.CHIP_TX].addActionListener(this);
    componentsMenu.add(adConverterMenuItem[Constants.CHIP_TX]);

    //Front panel: TX19 only
    frontPanelMenuItem = new JCheckBoxMenuItem("Front panel (TX only)");
    frontPanelMenuItem.setActionCommand(COMMAND_TOGGLE_FRONT_PANEL);
    frontPanelMenuItem.addActionListener(this);
    componentsMenu.add(frontPanelMenuItem);

    //Set up the trace menu.
    JMenu traceMenu = new JMenu("Trace");
    traceMenu.setMnemonic(KeyEvent.VK_C);
    menuBar.add(traceMenu);

    for (int chip = 0; chip < 2; chip++) {
        //memory activity viewer
        memoryActivityViewerMenuItem[chip] = new JCheckBoxMenuItem(
                Constants.CHIP_LABEL[chip] + " Memory activity viewer");
        memoryActivityViewerMenuItem[chip].setActionCommand(COMMAND_TOGGLE_MEMORY_ACTIVITY_VIEWER[chip]);
        memoryActivityViewerMenuItem[chip].addActionListener(this);
        traceMenu.add(memoryActivityViewerMenuItem[chip]);

        //disassembly
        disassemblyMenuItem[chip] = new JCheckBoxMenuItem(
                "Real-time " + Constants.CHIP_LABEL[chip] + " disassembly log");
        if (chip == Constants.CHIP_FR)
            disassemblyMenuItem[chip].setMnemonic(KEY_EVENT_REALTIME_DISASSEMBLY);
        disassemblyMenuItem[chip].setAccelerator(
                KeyStroke.getKeyStroke(KEY_EVENT_REALTIME_DISASSEMBLY, KEY_CHIP_MODIFIER[chip]));
        disassemblyMenuItem[chip].setActionCommand(COMMAND_TOGGLE_DISASSEMBLY_WINDOW[chip]);
        disassemblyMenuItem[chip].addActionListener(this);
        traceMenu.add(disassemblyMenuItem[chip]);

        //Custom logger
        customMemoryRangeLoggerMenuItem[chip] = new JCheckBoxMenuItem(
                "Custom " + Constants.CHIP_LABEL[chip] + " logger window");
        customMemoryRangeLoggerMenuItem[chip].setActionCommand(COMMAND_TOGGLE_CUSTOM_LOGGER_WINDOW[chip]);
        customMemoryRangeLoggerMenuItem[chip].addActionListener(this);
        traceMenu.add(customMemoryRangeLoggerMenuItem[chip]);

        //Call Stack logger
        callStackMenuItem[chip] = new JCheckBoxMenuItem(Constants.CHIP_LABEL[chip] + " Call stack logger");
        callStackMenuItem[chip].setActionCommand(COMMAND_TOGGLE_CALL_STACK_WINDOW[chip]);
        callStackMenuItem[chip].addActionListener(this);
        traceMenu.add(callStackMenuItem[chip]);

        //ITRON Object
        iTronObjectMenuItem[chip] = new JCheckBoxMenuItem("ITRON " + Constants.CHIP_LABEL[chip] + " Objects");
        iTronObjectMenuItem[chip].setActionCommand(COMMAND_TOGGLE_ITRON_OBJECT_WINDOW[chip]);
        iTronObjectMenuItem[chip].addActionListener(this);
        traceMenu.add(iTronObjectMenuItem[chip]);

        //ITRON Return Stack
        iTronReturnStackMenuItem[chip] = new JCheckBoxMenuItem(
                "ITRON " + Constants.CHIP_LABEL[chip] + " Return stack");
        iTronReturnStackMenuItem[chip].setActionCommand(COMMAND_TOGGLE_ITRON_RETURN_STACK_WINDOW[chip]);
        iTronReturnStackMenuItem[chip].addActionListener(this);
        traceMenu.add(iTronReturnStackMenuItem[chip]);

        traceMenu.add(new JSeparator());
    }

    //Set up the source menu.
    JMenu sourceMenu = new JMenu("Source");
    sourceMenu.setMnemonic(KEY_EVENT_SCREEN);
    menuBar.add(sourceMenu);

    // FR syscall symbols
    generateSysSymbolsMenuItem = new JMenuItem(
            "Generate " + Constants.CHIP_LABEL[Constants.CHIP_FR] + " system call symbols");
    generateSysSymbolsMenuItem.setActionCommand(COMMAND_GENERATE_SYS_SYMBOLS);
    generateSysSymbolsMenuItem.addActionListener(this);
    sourceMenu.add(generateSysSymbolsMenuItem);

    for (int chip = 0; chip < 2; chip++) {

        sourceMenu.add(new JSeparator());

        //analyse / disassemble
        analyseMenuItem[chip] = new JMenuItem("Analyse / Disassemble " + Constants.CHIP_LABEL[chip] + " code");
        analyseMenuItem[chip].setActionCommand(COMMAND_ANALYSE_DISASSEMBLE[chip]);
        analyseMenuItem[chip].addActionListener(this);
        sourceMenu.add(analyseMenuItem[chip]);

        sourceMenu.add(new JSeparator());

        //code structure
        codeStructureMenuItem[chip] = new JCheckBoxMenuItem(Constants.CHIP_LABEL[chip] + " code structure");
        codeStructureMenuItem[chip].setActionCommand(COMMAND_TOGGLE_CODE_STRUCTURE_WINDOW[chip]);
        codeStructureMenuItem[chip].addActionListener(this);
        sourceMenu.add(codeStructureMenuItem[chip]);

        //source code
        sourceCodeMenuItem[chip] = new JCheckBoxMenuItem(Constants.CHIP_LABEL[chip] + " source code");
        if (chip == Constants.CHIP_FR)
            sourceCodeMenuItem[chip].setMnemonic(KEY_EVENT_SOURCE);
        sourceCodeMenuItem[chip]
                .setAccelerator(KeyStroke.getKeyStroke(KEY_EVENT_SOURCE, KEY_CHIP_MODIFIER[chip]));
        sourceCodeMenuItem[chip].setActionCommand(COMMAND_TOGGLE_SOURCE_CODE_WINDOW[chip]);
        sourceCodeMenuItem[chip].addActionListener(this);
        sourceMenu.add(sourceCodeMenuItem[chip]);

        if (chip == Constants.CHIP_FR) {
            sourceMenu.add(new JSeparator());
        }
    }

    //Set up the tools menu.
    JMenu toolsMenu = new JMenu("Tools");
    toolsMenu.setMnemonic(KeyEvent.VK_T);
    menuBar.add(toolsMenu);

    for (int chip = 0; chip < 2; chip++) {
        // save/load memory area
        saveLoadMemoryMenuItem[chip] = new JMenuItem(
                "Save/Load " + Constants.CHIP_LABEL[chip] + " memory area");
        saveLoadMemoryMenuItem[chip].setActionCommand(COMMAND_SAVE_LOAD_MEMORY[chip]);
        saveLoadMemoryMenuItem[chip].addActionListener(this);
        toolsMenu.add(saveLoadMemoryMenuItem[chip]);

        //chip options
        chipOptionsMenuItem[chip] = new JMenuItem(Constants.CHIP_LABEL[chip] + " options");
        chipOptionsMenuItem[chip].setActionCommand(COMMAND_CHIP_OPTIONS[chip]);
        chipOptionsMenuItem[chip].addActionListener(this);
        toolsMenu.add(chipOptionsMenuItem[chip]);

        toolsMenu.add(new JSeparator());

    }

    //disassembly options
    uiOptionsMenuItem = new JMenuItem("Preferences");
    uiOptionsMenuItem.setActionCommand(COMMAND_UI_OPTIONS);
    uiOptionsMenuItem.addActionListener(this);
    toolsMenu.add(uiOptionsMenuItem);

    //Set up the help menu.
    JMenu helpMenu = new JMenu("?");
    menuBar.add(helpMenu);

    //about
    JMenuItem aboutMenuItem = new JMenuItem("About");
    aboutMenuItem.setActionCommand(COMMAND_ABOUT);
    aboutMenuItem.addActionListener(this);
    helpMenu.add(aboutMenuItem);

    //        JMenuItem testMenuItem = new JMenuItem("Test");
    //        testMenuItem.setActionCommand(COMMAND_TEST);
    //        testMenuItem.addActionListener(this);
    //        helpMenu.add(testMenuItem);

    // Global "Keep in sync" setting
    menuBar.add(Box.createHorizontalGlue());
    final JCheckBox syncEmulators = new JCheckBox("Keep emulators in sync");
    syncEmulators.setSelected(prefs.isSyncPlay());
    framework.getMasterClock().setSyncPlay(prefs.isSyncPlay());
    syncEmulators.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            prefs.setSyncPlay(syncEmulators.isSelected());
            framework.getMasterClock().setSyncPlay(syncEmulators.isSelected());
        }
    });
    menuBar.add(syncEmulators);
    return menuBar;
}

From source file:corelyzer.ui.CorelyzerApp.java

private JPopupMenu sectionListPopupMenu(final int[] rows) {
    // section popup
    JPopupMenu menu = new JPopupMenu("Sections");

    // Section/Image property
    JMenuItem propertiesMenuItem = new JMenuItem("Properties...");
    propertiesMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MENU_MASK));
    propertiesMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            controller.sectionProperties(rows);
        }/*w w w  .  j  a v a 2 s.  c om*/
    });

    JMenuItem splitMenuItem = new JMenuItem("Split...");
    if (rows.length > 1) {
        splitMenuItem.setEnabled(false);
    }
    splitMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            controller.sectionSplit();
        }
    });

    JMenuItem deleteMenuItem = new JMenuItem("Delete");
    deleteMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            onDeleteSelectedSections(rows);
        }
    });

    JMenuItem locateMenuItem = new JMenuItem("Locate");
    locateMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            onLocateSelectedSection();
        }
    });

    menu.add(locateMenuItem);
    menu.add(splitMenuItem);
    menu.add(propertiesMenuItem);
    menu.add(deleteMenuItem);

    return menu;
}

From source file:de.dmarcini.submatix.pclogger.gui.MainCommGUI.java

/**
 * Initialize the contents of the frame.
 * //from   w  w w .j av a  2s  . co m
 * @throws ClassNotFoundException
 * @throws SQLException
 */
private void initializeGUI() throws SQLException, ClassNotFoundException {
    frmMainWindow = new JFrame();
    frmMainWindow.setFont(new Font("Arial", Font.PLAIN, 12));
    frmMainWindow.setSize(new Dimension(810, 600));
    frmMainWindow.setResizable(false);
    frmMainWindow.setIconImage(Toolkit.getDefaultToolkit()
            .getImage(MainCommGUI.class.getResource("/de/dmarcini/submatix/pclogger/res/112.png")));
    frmMainWindow.setTitle(LangStrings.getString("MainCommGUI.frmMainWindow.title")); //$NON-NLS-1$
    frmMainWindow.setBounds(100, 100, 800, 600);
    frmMainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frmMainWindow.getContentPane().setLayout(new BorderLayout(0, 0));
    frmMainWindow.addWindowListener(new MainWindowListener());
    statusTextField = new JTextField();
    statusTextField.setEditable(false);
    statusTextField.setText("-");
    frmMainWindow.getContentPane().add(statusTextField, BorderLayout.SOUTH);
    statusTextField.setColumns(10);
    tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    frmMainWindow.getContentPane().add(tabbedPane, BorderLayout.CENTER);
    tabbedPane.addMouseMotionListener(this);
    // Connection Panel
    connectionPanel = new spx42ConnectPanel(databaseUtil);
    tabbedPane.addTab("CONNECTION", null, connectionPanel, null);
    tabbedPane.setEnabledAt(programTabs.TAB_CONNECT.ordinal(), true);
    // config Panel
    configPanel = new spx42ConfigPanel();
    tabbedPane.addTab("CONFIG", null, configPanel, null);
    tabbedPane.setEnabledAt(programTabs.TAB_CONFIG.ordinal(), true);
    // GASPANEL
    gasConfigPanel = new spx42GaslistEditPanel(databaseUtil);
    tabbedPane.addTab("GAS", null, gasConfigPanel, null);
    tabbedPane.setEnabledAt(programTabs.TAB_GASLIST.ordinal(), true);
    // Loglisten Panel
    logListPanel = new spx42LoglistPanel(this, databaseUtil);
    tabbedPane.addTab("LOG", null, logListPanel, null);
    tabbedPane.setEnabledAt(programTabs.TAB_LOGREAD.ordinal(), true);
    // Grafik Panel
    logGraphPanel = new spx42LogGraphPanel(databaseUtil);
    tabbedPane.addTab("GRAPH", null, logGraphPanel, null);
    tabbedPane.setEnabledAt(programTabs.TAB_LOGGRAPH.ordinal(), true);
    // import/export Panel
    fileManagerPanel = new spx42FileManagerPanel(this, databaseUtil);
    tabbedPane.addTab("EXPORT", null, fileManagerPanel, null);
    tabbedPane.setEnabledAt(programTabs.TAB_FILEMANAGER.ordinal(), true);
    // MEN
    JMenuBar menuBar = new JMenuBar();
    frmMainWindow.setJMenuBar(menuBar);
    mnFile = new JMenu(LangStrings.getString("MainCommGUI.mnFile.text")); //$NON-NLS-1$
    menuBar.add(mnFile);
    mntmExit = new JMenuItem(LangStrings.getString("MainCommGUI.mntmExit.text")); //$NON-NLS-1$
    mntmExit.setIcon(
            new ImageIcon(MainCommGUI.class.getResource("/de/dmarcini/submatix/pclogger/res/176.png")));
    mntmExit.setActionCommand("exit");
    mntmExit.addActionListener(this);
    mntmExit.addMouseMotionListener(this);
    mntmExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));
    mnFile.add(mntmExit);
    mnLanguages = new JMenu(LangStrings.getString("MainCommGUI.mnLanguages.text")); //$NON-NLS-1$
    mnLanguages.addMouseMotionListener(this);
    menuBar.add(mnLanguages);
    mnOptions = new JMenu(LangStrings.getString("MainCommGUI.mnOptions.text")); //$NON-NLS-1$
    mnOptions.addMouseMotionListener(this);
    menuBar.add(mnOptions);
    mntmOptions = new JMenuItem(LangStrings.getString("MainCommGUI.mntmOptions.text")); //$NON-NLS-1$
    mntmOptions.addMouseMotionListener(this);
    mntmOptions.addActionListener(this);
    mntmOptions.setActionCommand("set_propertys");
    mnOptions.add(mntmOptions);
    mnHelp = new JMenu(LangStrings.getString("MainCommGUI.mnHelp.text")); //$NON-NLS-1$
    mnHelp.addMouseMotionListener(this);
    menuBar.add(mnHelp);
    mntmHelp = new JMenuItem(LangStrings.getString("MainCommGUI.mntmHelp.text")); //$NON-NLS-1$
    mntmHelp.addActionListener(this);
    mntmHelp.setActionCommand("help");
    mntmHelp.addMouseMotionListener(this);
    mnHelp.add(mntmHelp);
    mntmInfo = new JMenuItem(LangStrings.getString("MainCommGUI.mntmInfo.text")); //$NON-NLS-1$
    mntmInfo.addActionListener(this);
    mntmInfo.setActionCommand("info");
    mntmInfo.addMouseMotionListener(this);
    mntmInfo.setIcon(
            new ImageIcon(MainCommGUI.class.getResource("/javax/swing/plaf/metal/icons/ocean/expanded.gif")));
    mntmInfo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK));
    mnHelp.add(mntmInfo);
}

From source file:edu.ku.brc.specify.Specify.java

/**
 * Create menus//from   www  .  j  av a 2 s  .  c o m
 */
public JMenuBar createMenus() {
    JMenuBar mb = new JMenuBar();
    JMenuItem mi;

    //--------------------------------------------------------------------
    //-- File Menu
    //--------------------------------------------------------------------

    JMenu menu = null;

    if (!UIHelper.isMacOS() || !isWorkbenchOnly) {
        menu = UIHelper.createLocalizedMenu(mb, "Specify.FILE_MENU", "Specify.FILE_MNEU"); //$NON-NLS-1$ //$NON-NLS-2$
    }

    if (!isWorkbenchOnly) {
        // Add Menu for switching Collection
        String title = "Specify.CHANGE_COLLECTION"; //$NON-NLS-1$
        String mnu = "Specify.CHANGE_COLL_MNEU"; //$NON-NLS-1$
        changeCollectionMenuItem = UIHelper.createLocalizedMenuItem(menu, title, mnu, title, false, null);
        changeCollectionMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                if (SubPaneMgr.getInstance().aboutToShutdown()) {

                    // Actually we really need to start over
                    // "true" means that it should NOT use any cached values it can find to automatically initialize itself
                    // instead it should ask the user any questions as if it were starting over
                    restartApp(null, databaseName, userName, true, false);
                }
            }
        });

        menu.addMenuListener(new MenuListener() {
            @Override
            public void menuCanceled(MenuEvent e) {
            }

            @Override
            public void menuDeselected(MenuEvent e) {
            }

            @Override
            public void menuSelected(MenuEvent e) {
                boolean enable = Uploader.getCurrentUpload() == null
                        && ((SpecifyAppContextMgr) AppContextMgr.getInstance()).getNumOfCollectionsForUser() > 1
                        && !TaskMgr.areTasksDisabled();

                changeCollectionMenuItem.setEnabled(enable);
            }

        });
    }

    if (UIHelper.getOSType() != UIHelper.OSTYPE.MacOSX) {
        if (!UIRegistry.isMobile()) {
            menu.addSeparator();
        }
        String title = "Specify.EXIT"; //$NON-NLS-1$
        String mnu = "Specify.Exit_MNEU"; //$NON-NLS-1$
        mi = UIHelper.createLocalizedMenuItem(menu, title, mnu, title, true, null);
        if (!UIHelper.isMacOS()) {
            mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, InputEvent.CTRL_DOWN_MASK));
        }
        mi.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                doExit(true);
            }
        });
    }

    menu = UIRegistry.getInstance().createEditMenu();
    mb.add(menu);

    //menu = UIHelper.createMenu(mb, "EditMenu", "EditMneu");
    if (UIHelper.getOSType() != UIHelper.OSTYPE.MacOSX) {
        menu.addSeparator();
        String title = "Specify.PREFERENCES"; //$NON-NLS-1$
        String mnu = "Specify.PREFERENCES_MNEU";//$NON-NLS-1$
        mi = UIHelper.createLocalizedMenuItem(menu, title, mnu, title, false, null);
        mi.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                doPreferences();
            }
        });
        mi.setEnabled(true);
    }

    //--------------------------------------------------------------------
    //-- Data Menu
    //--------------------------------------------------------------------
    JMenu dataMenu = UIHelper.createLocalizedMenu(mb, "Specify.DATA_MENU", "Specify.DATA_MNEU"); //$NON-NLS-1$ //$NON-NLS-2$
    ResultSetController.addMenuItems(dataMenu);
    dataMenu.addSeparator();

    // Save And New Menu Item
    Action saveAndNewAction = new AbstractAction(getResourceString("Specify.SAVE_AND_NEW")) { //$NON-NLS-1$
        public void actionPerformed(ActionEvent e) {
            FormViewObj fvo = getCurrentFVO();
            if (fvo != null) {
                fvo.setSaveAndNew(((JCheckBoxMenuItem) e.getSource()).isSelected());
            }
        }
    };
    saveAndNewAction.setEnabled(false);
    JCheckBoxMenuItem saveAndNewCBMI = new JCheckBoxMenuItem(saveAndNewAction);
    dataMenu.add(saveAndNewCBMI);
    UIRegistry.register("SaveAndNew", saveAndNewCBMI); //$NON-NLS-1$
    UIRegistry.registerAction("SaveAndNew", saveAndNewAction); //$NON-NLS-1$
    mb.add(dataMenu);

    // Configure Carry Forward
    Action configCarryForwardAction = new AbstractAction(
            getResourceString("Specify.CONFIG_CARRY_FORWARD_MENU")) { //$NON-NLS-1$
        public void actionPerformed(ActionEvent e) {
            FormViewObj fvo = getCurrentFVO();
            if (fvo != null) {
                fvo.configureCarryForward();
            }
        }
    };
    configCarryForwardAction.setEnabled(false);
    JMenuItem configCFWMI = new JMenuItem(configCarryForwardAction);
    dataMenu.add(configCFWMI);
    UIRegistry.register("ConfigCarryForward", configCFWMI); //$NON-NLS-1$
    UIRegistry.registerAction("ConfigCarryForward", configCarryForwardAction); //$NON-NLS-1$
    mb.add(dataMenu);

    //---------------------------------------
    // Carry Forward Menu Item (On / Off)
    Action carryForwardAction = new AbstractAction(getResourceString("Specify.CARRY_FORWARD_CHECKED_MENU")) { //$NON-NLS-1$
        public void actionPerformed(ActionEvent e) {
            FormViewObj fvo = getCurrentFVO();
            if (fvo != null) {
                fvo.toggleCarryForward();
                ((JCheckBoxMenuItem) e.getSource()).setSelected(fvo.isDoCarryForward());
            }
        }
    };
    carryForwardAction.setEnabled(false);
    JCheckBoxMenuItem carryForwardCBMI = new JCheckBoxMenuItem(carryForwardAction);
    dataMenu.add(carryForwardCBMI);
    UIRegistry.register("CarryForward", carryForwardCBMI); //$NON-NLS-1$
    UIRegistry.registerAction("CarryForward", carryForwardAction); //$NON-NLS-1$
    mb.add(dataMenu);

    if (!isWorkbenchOnly) {
        final String AUTO_NUM = "AutoNumbering";
        //---------------------------------------
        // AutoNumber Menu Item (On / Off)
        Action autoNumberOnOffAction = new AbstractAction(
                getResourceString("FormViewObj.SET_AUTONUMBER_ONOFF")) { //$NON-NLS-1$
            public void actionPerformed(ActionEvent e) {
                FormViewObj fvo = getCurrentFVO();
                if (fvo != null) {
                    fvo.toggleAutoNumberOnOffState();
                    ((JCheckBoxMenuItem) e.getSource()).setSelected(fvo.isAutoNumberOn());
                }
            }
        };
        autoNumberOnOffAction.setEnabled(false);
        JCheckBoxMenuItem autoNumCBMI = new JCheckBoxMenuItem(autoNumberOnOffAction);
        dataMenu.add(autoNumCBMI);
        UIRegistry.register(AUTO_NUM, autoNumCBMI); //$NON-NLS-1$
        UIRegistry.registerAction(AUTO_NUM, autoNumberOnOffAction); //$NON-NLS-1$
    }

    if (System.getProperty("user.name").equals("rods")) {
        dataMenu.addSeparator();

        AbstractAction gpxAction = new AbstractAction("GPS Data") {
            @Override
            public void actionPerformed(ActionEvent e) {
                GPXPanel.getDlgInstance().setVisible(true);
            }
        };
        JMenuItem gpxMI = new JMenuItem(gpxAction);
        dataMenu.add(gpxMI);
        UIRegistry.register("GPXDlg", gpxMI); //$NON-NLS-1$
        UIRegistry.registerAction("GPXDlg", gpxAction); //$NON-NLS-1$
    }

    mb.add(dataMenu);

    SubPaneMgr.getInstance(); // force creating of the Mgr so the menu Actions are created.

    //--------------------------------------------------------------------
    //-- System Menu
    //--------------------------------------------------------------------

    if (!isWorkbenchOnly) {
        // TODO This needs to be moved into the SystemTask, but right now there is no way
        // to ask a task for a menu.
        menu = UIHelper.createLocalizedMenu(mb, "Specify.SYSTEM_MENU", "Specify.SYSTEM_MNEU"); //$NON-NLS-1$ //$NON-NLS-2$

        /*if (true)
        {
        menu = UIHelper.createMenu(mb, "Forms", "o");
        Action genForms = new AbstractAction()
        {
            public void actionPerformed(ActionEvent ae)
            {
                FormGenerator fg = new FormGenerator();
                fg.generateForms();
            }
        };
        mi = UIHelper.createMenuItemWithAction(menu, "Generate All Forms", "G", "", true, genForms);
        }*/
    }

    //--------------------------------------------------------------------
    //-- Tab Menu
    //--------------------------------------------------------------------
    menu = UIHelper.createLocalizedMenu(mb, "Specify.TABS_MENU", "Specify.TABS_MNEU"); //$NON-NLS-1$ //$NON-NLS-2$

    String ttl = UIRegistry.getResourceString("Specify.SBP_CLOSE_CUR_MENU");
    String mnu = UIRegistry.getResourceString("Specify.SBP_CLOSE_CUR_MNEU");
    mi = UIHelper.createMenuItemWithAction(menu, ttl, mnu, ttl, true, getAction("CloseCurrent"));
    if (!UIHelper.isMacOS()) {
        mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_DOWN_MASK));
    }

    ttl = UIRegistry.getResourceString("Specify.SBP_CLOSE_ALL_MENU");
    mnu = UIRegistry.getResourceString("Specify.SBP_CLOSE_ALL_MNEU");
    mi = UIHelper.createMenuItemWithAction(menu, ttl, mnu, ttl, true, getAction("CloseAll"));
    if (!UIHelper.isMacOS()) {
        mi.setAccelerator(
                KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
    }

    ttl = UIRegistry.getResourceString("Specify.SBP_CLOSE_ALLBUT_MENU");
    mnu = UIRegistry.getResourceString("Specify.SBP_CLOSE_ALLBUT_MNEU");
    mi = UIHelper.createMenuItemWithAction(menu, ttl, mnu, ttl, true, getAction("CloseAllBut"));

    menu.addSeparator();

    // Configure Task
    JMenuItem configTaskMI = new JMenuItem(getAction("ConfigureTask"));
    menu.add(configTaskMI);
    //UIRegistry.register("ConfigureTask", configTaskMI); //$NON-NLS-1$

    //--------------------------------------------------------------------
    //-- Debug Menu
    //--------------------------------------------------------------------

    boolean doDebug = AppPreferences.getLocalPrefs().getBoolean("debug.menu", false);
    if (!UIRegistry.isRelease() || doDebug) {
        menu = UIHelper.createLocalizedMenu(mb, "Specify.DEBUG_MENU", "Specify.DEBUG_MNEU"); //$NON-NLS-1$ //$NON-NLS-2$
        String ttle = "Specify.SHOW_LOC_PREFS";//$NON-NLS-1$ 
        String mneu = "Specify.SHOW_LOC_PREF_MNEU";//$NON-NLS-1$ 
        String desc = "Specify.SHOW_LOC_PREFS";//$NON-NLS-1$ 
        mi = UIHelper.createLocalizedMenuItem(menu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$ 
            public void actionPerformed(ActionEvent ae) {
                openLocalPrefs();
            }
        });

        ttle = "Specify.SHOW_REM_PREFS";//$NON-NLS-1$ 
        mneu = "Specify.SHOW_REM_PREFS_MNEU";//$NON-NLS-1$ 
        desc = "Specify.SHOW_REM_PREFS";//$NON-NLS-1$ 
        mi = UIHelper.createLocalizedMenuItem(menu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$
            public void actionPerformed(ActionEvent ae) {
                openRemotePrefs();
            }
        });

        menu.addSeparator();

        ttle = "Specify.CONFIG_LOGGERS";//$NON-NLS-1$ 
        mneu = "Specify.CONFIG_LOGGERS_MNEU";//$NON-NLS-1$ 
        desc = "Specify.CONFIG_LOGGER";//$NON-NLS-1$ 
        mi = UIHelper.createLocalizedMenuItem(menu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$
            public void actionPerformed(ActionEvent ae) {
                final LoggerDialog dialog = new LoggerDialog(topFrame);
                UIHelper.centerAndShow(dialog);
            }
        });

        ttle = "Specify.CONFIG_DEBUG_LOGGERS";//$NON-NLS-1$ 
        mneu = "Specify.CONFIG_DEBUG_LOGGERS_MNEU";//$NON-NLS-1$ 
        desc = "Specify.CONFIG_DEBUG_LOGGER";//$NON-NLS-1$ 
        mi = UIHelper.createLocalizedMenuItem(menu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$
            public void actionPerformed(ActionEvent ae) {
                DebugLoggerDialog dialog = new DebugLoggerDialog(topFrame);
                UIHelper.centerAndShow(dialog);
            }
        });

        menu.addSeparator();

        ttle = "Specify.SHOW_MEM_STATS";//$NON-NLS-1$ 
        mneu = "Specify.SHOW_MEM_STATS_MNEU";//$NON-NLS-1$ 
        desc = "Specify.SHOW_MEM_STATS";//$NON-NLS-1$ 
        mi = UIHelper.createLocalizedMenuItem(menu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$
            public void actionPerformed(ActionEvent ae) {
                System.gc();
                System.runFinalization();

                // Get current size of heap in bytes
                double meg = 1024.0 * 1024.0;
                double heapSize = Runtime.getRuntime().totalMemory() / meg;

                // Get maximum size of heap in bytes. The heap cannot grow beyond this size.
                // Any attempt will result in an OutOfMemoryException.
                double heapMaxSize = Runtime.getRuntime().maxMemory() / meg;

                // Get amount of free memory within the heap in bytes. This size will increase
                // after garbage collection and decrease as new objects are created.
                double heapFreeSize = Runtime.getRuntime().freeMemory() / meg;

                UIRegistry.getStatusBar()
                        .setText(String.format("Heap Size: %7.2f    Max: %7.2f    Free: %7.2f   Used: %7.2f", //$NON-NLS-1$
                                heapSize, heapMaxSize, heapFreeSize, (heapSize - heapFreeSize)));
            }
        });

        JMenu prefsMenu = new JMenu(UIRegistry.getResourceString("Specify.PREFS_IMPORT_EXPORT")); //$NON-NLS-1$
        menu.add(prefsMenu);
        ttle = "Specify.IMPORT_MENU";//$NON-NLS-1$ 
        mneu = "Specify.IMPORT_MNEU";//$NON-NLS-1$ 
        desc = "Specify.IMPORT_PREFS";//$NON-NLS-1$ 
        mi = UIHelper.createLocalizedMenuItem(prefsMenu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$
            public void actionPerformed(ActionEvent ae) {
                importPrefs();
            }
        });
        ttle = "Specify.EXPORT_MENU";//$NON-NLS-1$ 
        mneu = "Specify.EXPORT_MNEU";//$NON-NLS-1$ 
        desc = "Specify.EXPORT_PREFS";//$NON-NLS-1$ 
        mi = UIHelper.createLocalizedMenuItem(prefsMenu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$
            public void actionPerformed(ActionEvent ae) {
                exportPrefs();
            }
        });

        ttle = "Associate Storage Items";//$NON-NLS-1$ 
        mneu = "A";//$NON-NLS-1$ 
        desc = "";//$NON-NLS-1$ 
        mi = UIHelper.createMenuItemWithAction(menu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$
            public void actionPerformed(ActionEvent ae) {
                associateStorageItems();
            }
        });

        ttle = "Load GPX Points";//$NON-NLS-1$ 
        mneu = "a";//$NON-NLS-1$ 
        desc = "";//$NON-NLS-1$ 
        mi = UIHelper.createMenuItemWithAction(menu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            @SuppressWarnings("synthetic-access") //$NON-NLS-1$
            public void actionPerformed(ActionEvent ae) {
                CustomDialog dlg = GPXPanel.getDlgInstance();
                if (dlg != null) {
                    dlg.setVisible(true);
                }
            }
        });

        JCheckBoxMenuItem cbMenuItem = new JCheckBoxMenuItem("Security Activated"); //$NON-NLS-1$
        menu.add(cbMenuItem);
        cbMenuItem.setSelected(AppContextMgr.isSecurityOn());
        cbMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                boolean isSecurityOn = !SpecifyAppContextMgr.isSecurityOn();
                AppContextMgr.getInstance().setSecurity(isSecurityOn);
                ((JMenuItem) ae.getSource()).setSelected(isSecurityOn);

                JLabel secLbl = statusField.getSectionLabel(3);
                if (secLbl != null) {
                    secLbl.setIcon(IconManager.getImage(isSecurityOn ? "SecurityOn" : "SecurityOff",
                            IconManager.IconSize.Std16));
                    secLbl.setHorizontalAlignment(SwingConstants.CENTER);
                    secLbl.setToolTipText(getResourceString("Specify.SEC_" + (isSecurityOn ? "ON" : "OFF")));
                }
            }
        });

        JMenuItem sizeMenuItem = new JMenuItem("Set to " + PREFERRED_WIDTH + "x" + PREFERRED_HEIGHT); //$NON-NLS-1$
        menu.add(sizeMenuItem);
        sizeMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                topFrame.setSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
            }
        });
    }

    //----------------------------------------------------
    //-- Helper Menu
    //----------------------------------------------------

    JMenu helpMenu = UIHelper.createLocalizedMenu(mb, "Specify.HELP_MENU", "Specify.HELP_MNEU"); //$NON-NLS-1$ //$NON-NLS-2$
    HelpMgr.createHelpMenuItem(helpMenu, getResourceString("SPECIFY_HELP")); //$NON-NLS-1$
    helpMenu.addSeparator();

    String ttle = "Specify.LOG_SHOW_FILES";//$NON-NLS-1$ 
    String mneu = "Specify.LOG_SHOW_FILES_MNEU";//$NON-NLS-1$ 
    String desc = "Specify.LOG_SHOW_FILES";//$NON-NLS-1$      
    mi = UIHelper.createLocalizedMenuItem(helpMenu, ttle, mneu, desc, true, null);
    helpMenu.addSeparator();
    mi.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent ae) {
            AppBase.displaySpecifyLogFiles();
        }
    });

    ttle = "SecurityAdminTask.CHANGE_PWD_MENU"; //$NON-NLS-1$
    mneu = "SecurityAdminTask.CHANGE_PWD_MNEU"; //$NON-NLS-1$
    desc = "SecurityAdminTask.CHANGE_PWD_DESC"; //$NON-NLS-1$
    mi = UIHelper.createLocalizedMenuItem(helpMenu, ttle, mneu, desc, true, null);
    mi.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent ae) {
            SecurityAdminTask.changePassword(true);
        }
    });

    ttle = "Specify.CHECK_UPDATE";//$NON-NLS-1$ 
    mneu = "Specify.CHECK_UPDATE_MNEU";//$NON-NLS-1$ 
    desc = "Specify.CHECK_UPDATE_DESC";//$NON-NLS-1$      
    mi = UIHelper.createLocalizedMenuItem(helpMenu, ttle, mneu, desc, true, null);
    mi.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent ae) {
            checkForUpdates();
        }
    });

    ttle = "Specify.AUTO_REG";//$NON-NLS-1$ 
    mneu = "Specify.AUTO_REG_MNEU";//$NON-NLS-1$ 
    desc = "Specify.AUTO_REG_DESC";//$NON-NLS-1$      
    mi = UIHelper.createLocalizedMenuItem(helpMenu, ttle, mneu, desc, true, null);
    mi.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent ae) {
            RegisterSpecify.register(true, 0);
        }
    });

    ttle = "Specify.SA_REG";//$NON-NLS-1$ 
    mneu = "Specify.SA_REG_MNEU";//$NON-NLS-1$ 
    desc = "Specify.SA_REG_DESC";//$NON-NLS-1$      
    mi = UIHelper.createLocalizedMenuItem(helpMenu, ttle, mneu, desc, true, null);
    mi.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent ae) {
            RegisterSpecify.registerISA();
        }
    });

    ttle = "Specify.FEEDBACK";//$NON-NLS-1$ 
    mneu = "Specify.FB_MNEU";//$NON-NLS-1$ 
    desc = "Specify.FB_DESC";//$NON-NLS-1$      
    mi = UIHelper.createLocalizedMenuItem(helpMenu, ttle, mneu, desc, true, null);
    mi.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent ae) {
            FeedBackDlg feedBackDlg = new FeedBackDlg();
            feedBackDlg.sendFeedback();
        }
    });

    if (UIHelper.getOSType() != UIHelper.OSTYPE.MacOSX) {
        helpMenu.addSeparator();

        ttle = "Specify.ABOUT";//$NON-NLS-1$ 
        mneu = "Specify.ABOUTMNEU";//$NON-NLS-1$ 
        desc = "Specify.ABOUT";//$NON-NLS-1$ 
        mi = UIHelper.createLocalizedMenuItem(helpMenu, ttle, mneu, desc, true, null);
        mi.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                doAbout();
            }
        });
    }
    return mb;
}

From source file:corelyzer.ui.CorelyzerApp.java

private void setupMenuStuff() {
    menuBar = new JMenuBar();

    // Create File Menu
    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);

    JMenuItem createSessionMenuItem = new JMenuItem("Create a Session", KeyEvent.VK_N);
    createSessionMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MENU_MASK));
    createSessionMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.createSession();/*from  w  w w.j a va  2 s.com*/
        }
    });
    createSessionMenuItem.setEnabled(true);
    fileMenu.add(createSessionMenuItem);

    createTrackMenuItem = new JMenuItem("Create a Track", KeyEvent.VK_T);
    createTrackMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, MENU_MASK));
    createTrackMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.createTrack();
        }
    });
    createTrackMenuItem.setEnabled(false);
    fileMenu.add(createTrackMenuItem);

    fileMenu.addSeparator();

    // Images
    JMenu loadImageMenu = new JMenu("Load Images");
    loadImageMenuItem = new JMenuItem("Open Local Image Files...", KeyEvent.VK_M);
    loadImageMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, MENU_MASK));
    loadImageMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadImageAction();
        }
    });
    loadImageMenu.add(loadImageMenuItem);

    // "Auto-load" 4/25/2012 brg
    JMenuItem autoLoadImageMenuItem = new JMenuItem("Open Image Listing...");
    autoLoadImageMenuItem.setEnabled(true);
    autoLoadImageMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadImageListingAction();
        }
    });
    loadImageMenu.add(autoLoadImageMenuItem);

    // online image services
    JMenuItem chronosMenuItem = new JMenuItem("Online Image Services...");
    loadImageMenu.add(chronosMenuItem);
    chronosMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(1);
            d.setVisible(true);
        }
    });

    fileMenu.add(loadImageMenu);

    // Numbercal data (plots)
    JMenu loadDataMenu = new JMenu("Load Data");

    loadDataMenuItem = new JMenuItem("Open Local Dataset Files", KeyEvent.VK_D);
    loadDataMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, MENU_MASK));
    loadDataMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            Runnable r = new Runnable() {
                public void run() {
                    controller.loadData();
                }
            };

            new Thread(r).start();
        }
    });
    loadDataMenu.add(loadDataMenuItem);
    fileMenu.add(loadDataMenu);

    JMenuItem quickDataImportMenuItem = new JMenuItem("Quick Data Import...");
    quickDataImportMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.quickDataImport();
        }
    });
    loadDataMenu.add(quickDataImportMenuItem);

    JMenuItem importDataMenuItem = new JMenuItem("Custom Data Import...");
    importDataMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.importData();
        }
    });
    loadDataMenu.add(importDataMenuItem);

    // LoggingDB
    JMenuItem loggingDBMenuItem = new JMenuItem("LDEO logging DB...");
    loggingDBMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(2);
            d.setVisible(true);
        }
    });
    loadDataMenu.add(loggingDBMenuItem);

    fileMenu.addSeparator();

    loadStateFileMenuItem = new JMenuItem("Open a Session File", KeyEvent.VK_O);
    loadStateFileMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MENU_MASK));
    loadStateFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadStateFile();
        }
    });
    loadStateFileMenuItem.setEnabled(false);
    fileMenu.add(loadStateFileMenuItem);

    JMenuItem saveMenuItem = new JMenuItem("Save Session", KeyEvent.VK_S);
    saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MENU_MASK));
    saveMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            controller.saveCurrentSession();
        }
    });
    fileMenu.add(saveMenuItem);

    JMenuItem saveStateToFileMenuItem = new JMenuItem("Save Session As...", KeyEvent.VK_S);
    saveStateToFileMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, MENU_MASK));
    saveStateToFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.saveStateToFile();
        }
    });
    fileMenu.add(saveStateToFileMenuItem);

    // Session History
    recentSessionsMenu = new JMenu("Recent Sessions");
    controller.refreshSessionHistoryMenu();
    fileMenu.add(recentSessionsMenu);

    fileMenu.addSeparator();

    JMenu packageMenu = new JMenu("Core Archive");
    JMenuItem importMenuItem = new JMenuItem("Import...");
    importMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.importPackage();
        }
    });
    packageMenu.add(importMenuItem);

    JMenuItem exportMenuItem = new JMenuItem("Export...");
    exportMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.exportTheWholeScene();
        }
    });
    packageMenu.add(exportMenuItem);
    fileMenu.add(packageMenu);

    JMenu limsMenu = new JMenu("IODP");

    JMenuItem allIODPLists = new JMenuItem("All IODP lists...");
    allIODPLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    limsMenu.add(allIODPLists);

    JMenuItem loadLIMSTables = new JMenuItem("Load a section list...");
    loadLIMSTables.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadLIMSTables(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(0);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadLIMSTables);

    JMenuItem loadAffineTable = new JMenuItem("Load an affine table...");
    loadAffineTable.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadAAffineTable(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(3);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadAffineTable);

    JMenuItem loadSpliceTable = new JMenuItem("Load a splice table...");
    loadSpliceTable.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadASpliceTable(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(4);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadSpliceTable);

    fileMenu.add(limsMenu);

    JMenu disMenu = new JMenu("DIS");

    JMenuItem disListMenuItem = new JMenuItem("Accessing DIS...");
    disListMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            DISListsDialog d = new DISListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });

    JMenuItem disImport = new JMenuItem("Import...");
    disImport.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disImport();
        }
    });
    JMenuItem disExport = new JMenuItem("Export...");
    disExport.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disExport();
        }
    });

    JMenuItem disBatchDataLoad = new JMenuItem("Load Tab Delimited Data File...");
    disBatchDataLoad.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disBatchDataLoad();
        }
    });

    disMenu.add(disListMenuItem);
    disMenu.add(disImport);
    disMenu.add(disExport);
    disMenu.add(disBatchDataLoad);
    fileMenu.add(disMenu);

    JMenuItem saveOutputToFileMenuItem = new JMenuItem("Export Sheets...", KeyEvent.VK_A);
    saveOutputToFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.saveOutputToFile();
        }
    });
    fileMenu.add(saveOutputToFileMenuItem);

    fileMenu.addSeparator();

    JMenuItem quitMenuItem = new JMenuItem("Quit");
    fileMenu.add(quitMenuItem);
    quitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, MENU_MASK));
    quitMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.quit();
        }
    });

    menuBar.add(fileMenu);

    // Create Edit Menu
    JMenu editMenu = new JMenu("Edit");
    editMenu.setMnemonic(KeyEvent.VK_E);

    JMenuItem clearImageCacheMenuItem = new JMenuItem("Clear Image Cache...", KeyEvent.VK_I);
    clearImageCacheMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.clearImageCache();
        }
    });
    editMenu.add(clearImageCacheMenuItem);

    editMenu.addSeparator();
    JMenuItem depthDirection = new JMenuItem("Switch Depth Direction", KeyEvent.VK_K);
    depthDirection.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_K, MENU_MASK));
    depthDirection.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            boolean b = SceneGraph.getDepthOrientation();
            SceneGraph.setDepthOrientation(!b);

            CorelyzerApp.getApp().updateGLWindows();
        }
    });
    editMenu.add(depthDirection);

    JMenuItem tour = new JMenuItem("Tour...");
    tour.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            CRNavigationSetupDialog dlg = new CRNavigationSetupDialog();
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });

    editMenu.add(tour);

    editMenu.addSeparator();
    JMenuItem preferencesMenuItem = new JMenuItem("Preferences...");
    editMenu.add(preferencesMenuItem);
    preferencesMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.doPreferences();
        }
    });

    menuBar.add(editMenu);

    // Create Share Menu
    JMenu shareMenu = new JMenu("Share");

    JMenuItem publishMenuItem = new JMenuItem("Publish...");
    publishMenuItem.setEnabled(true);
    publishMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            controller.publishASession();
        }
    });
    shareMenu.add(publishMenuItem);

    JMenuItem listMenuItem = new JMenuItem("List...");
    listMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            controller.listSessions();
        }
    });
    shareMenu.add(listMenuItem);

    shareMenu.addSeparator();

    friendsMenu = new JMenu("Friends");
    shareMenu.add(friendsMenu);

    menuBar.add(shareMenu);

    // Create Debug Menu
    JMenu debugMenu = new JMenu("Debug");
    debugMenu.setMnemonic(KeyEvent.VK_D);

    JMenuItem matchTestMenuItem = new JMenuItem("Match-Test", KeyEvent.VK_B);
    matchTestMenuItem.addActionListener(new ActionListener() {

        public void actionPerformed(final ActionEvent event) {
            controller.testAndMatch();
        }
    });

    debugMenu.add(matchTestMenuItem);

    if ((System.getenv("DEBUG") != null) && System.getenv("DEBUG").equals("YES")) {
        menuBar.add(shareMenu);
    }

    // Create the Plugin Menu
    pluginMenu = new JMenu("Plugins");
    menuBar.add(pluginMenu);
    pluginMenuItemVec = new Vector<JMenuItem>();

    // Lists
    JMenu listsMenu = new JMenu("Lists");

    JMenuItem iodpLists = new JMenuItem("IODP lists...");
    iodpLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    listsMenu.add(iodpLists);

    JMenuItem disLists = new JMenuItem("DIS lists...");
    disLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            DISListsDialog d = new DISListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    listsMenu.add(disLists);

    JMenu annotLists = new JMenu("Annotation");

    JMenuItem freeformsItem = new JMenuItem("Default");
    freeformsItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            FreeformAnnotationListDialog dlg = new FreeformAnnotationListDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(freeformsItem);

    JMenuItem clastListItem = new JMenuItem("Clast");
    clastListItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            ClastStatisticsDialog dlg = new ClastStatisticsDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(clastListItem);

    JMenuItem sampleReqsItem = new JMenuItem("Sample");
    sampleReqsItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            SampleRequestListDialog dlg = new SampleRequestListDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(sampleReqsItem);
    listsMenu.add(annotLists);

    menuBar.add(listsMenu);

    // Create Tools Menu
    JMenu toolsMenu = new JMenu("Tools");
    JMenuItem wholeCoreViewerMenuItem = new JMenuItem("Get 3D Whole Core Imagery Viewer...");
    wholeCoreViewerMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            try {
                String app;
                String url = "http://www.evl.uic.edu/cavern/corewall/SciVizCore/";

                if (System.getProperty("os.name").toLowerCase().contains("windows")) {
                    app = "cmd.exe /c explorer " + url;
                    Runtime.getRuntime().exec(app);
                } else {
                    app = "open";
                    String[] cmd = { app, url };
                    Runtime.getRuntime().exec(cmd);
                }
            } catch (IOException ex) {
                System.err.println("IOException in opening SciVizCore link");
            }
        }
    });

    toolsMenu.add(wholeCoreViewerMenuItem);

    // DEBUG
    String debug = System.getProperty("DEBUG");
    if ((debug != null) && System.getProperty("DEBUG").equals("true")) {
        JMenuItem gcItem = new JMenuItem("GC");
        gcItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent event) {
                long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- B4 mem:\t" + mem0 / 1000000.0f);

                int trials = 10000;
                for (int i = 0; i < trials; i++) {
                    updateGLWindows();
                }

                long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- " + trials + " mem:\t" + mem1 / 1000000.0f);

                System.gc();
                System.gc();
                System.gc();

                long mem2 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- AferGC mem:\t" + mem2 / 1000000.0f);
            }
        });
        toolsMenu.add(gcItem);
    }

    menuBar.add(toolsMenu);

    // Create Help Menu
    // Create JavaHelp hooks
    File helpSet = new File("help/jhelpset.hs");
    HelpSet hs = null;
    try {
        URL hsURL = helpSet.toURI().toURL();
        hs = new HelpSet(null, hsURL);
    } catch (HelpSetException e) {
        JOptionPane.showMessageDialog(getMainFrame(), "Cannot find help: format error.");
        e.printStackTrace();
    } catch (MalformedURLException e) {
        JOptionPane.showMessageDialog(getMainFrame(), "Cannot find help: malformed URL.");
        e.printStackTrace();
    }

    // Help UI
    JMenu helpMenu = new JMenu("Help");
    JMenuItem helpMenuItem = new JMenuItem("Help", KeyEvent.VK_H);

    if (hs != null) {
        HelpBroker hb = hs.createHelpBroker();
        helpActionListener = new CSH.DisplayHelpFromSource(hb);
        helpMenuItem.addActionListener(helpActionListener);
    } else {
        helpMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent event) {
                controller.helpAction();
            }
        });
    }
    helpMenu.add(helpMenuItem);

    helpMenu.addSeparator();
    JMenuItem aboutMenuItem = new JMenuItem("About Corelyzer");
    helpMenu.add(aboutMenuItem);
    aboutMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.about();
        }
    });

    menuBar.add(helpMenu);

    mainFrame.setJMenuBar(menuBar);
}

From source file:br.com.atmatech.sac.view.ViewListaAtendimento.java

private void inicializaAtalhos() {
    KeyStroke keyStrokeJBnovo = KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0);
    String actionNameJBnovo = "TECLA_F1";
    InputMap inputMapJBnovo = jBnovo.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    inputMapJBnovo.put(keyStrokeJBnovo, actionNameJBnovo);
    ActionMap actionMapJBMARCA = jBnovo.getActionMap();
    actionMapJBMARCA.put(actionNameJBnovo, acaojBnovo);

    //Atalho excluir
    KeyStroke keyStrokeJBexcluir = KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0);
    String actionNameJBexcluir = "F4";
    InputMap inputMapJBexcluir = jBexcluir.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    inputMapJBexcluir.put(keyStrokeJBexcluir, actionNameJBexcluir);
    ActionMap actionMapJBexcluir = jBexcluir.getActionMap();
    actionMapJBexcluir.put(actionNameJBexcluir, acaoJBexcluir);

    //Atalho atualizar
    KeyStroke keyStrokeJBatualizar = KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0);
    String actionNameJBatualizar = "F5";
    InputMap inputMapJBatualizar = jBpesquisa.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    inputMapJBatualizar.put(keyStrokeJBatualizar, actionNameJBatualizar);
    ActionMap actionMapJBatualizar = jBpesquisa.getActionMap();
    actionMapJBatualizar.put(actionNameJBatualizar, acaoJBpesquisa);

    //Atalho enter
    InputMap inputMapJBenter = this.jDconsulta.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    inputMapJBenter.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "forward");
    this.jDconsulta.getRootPane().setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, inputMapJBenter);
    this.jDconsulta.getRootPane().getActionMap().put("forward", new AbstractAction() {
        private static final long serialVersionUID = 1L;

        @Override//w  w w .j ava 2  s .com
        public void actionPerformed(ActionEvent e) {
            filtraChamado();
        }

    });

}

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

private void initFileMenu(JMenu mnFile) {
    mnFile.removeAll();//from   ww w.  j  a  v a2 s .c o m

    // non-dynamic
    for (MyAction action : fileActions) {
        if (action == null) {
            mnFile.addSeparator();
        } else {
            JMenuItem item = mnFile.add(action);
            if (action.accelerator != null) {
                item.setAccelerator(action.accelerator);
            }
        }
    }

    // import (not in action list as doesn't appear on toolbar)
    mnFile.addSeparator();
    JMenu mnImport = new JMenu("Import");
    mnFile.add(mnImport);

    class ImportPair {
        String menuString;
        SupportedFileType type;

        public ImportPair(String menuString, SupportedFileType type) {
            super();
            this.menuString = menuString;
            this.type = type;
        }
    }
    for (final ImportPair type : new ImportPair[] {
            new ImportPair("Comma separated (CSV) text", SupportedFileType.CSV),
            new ImportPair("Tab separated text", SupportedFileType.TABBED),
            new ImportPair("Excel", SupportedFileType.EXCEL),
            new ImportPair("Shapefile (link geometry to original file)",
                    SupportedFileType.SHAPEFILE_LINKED_GEOM),
            new ImportPair("Shapefile (copy geometry into spreadsheet)",
                    SupportedFileType.SHAPEFILE_COPIED_GEOM), }) {
        mnImport.add(new AbstractAction(type.menuString) {

            @Override
            public void actionPerformed(ActionEvent e) {
                importFile(type.type);
            }
        });
    }

    // dynamic
    mnFile.addSeparator();
    List<File> recent = PreferencesManager.getSingleton().getRecentFiles();
    for (int i = 0; i < recent.size(); i++) {
        final File file = recent.get(i);
        String s = Integer.toString(i + 1) + ". " + file.getAbsolutePath();
        int maxLen = 100;
        if (s.length() > maxLen) {
            s = s.substring(0, maxLen) + "...";
        }
        mnFile.add(new MyAction(s, "Load file " + file.getAbsolutePath(), null, null, false, null) {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (!canCloseDatastore()) {
                    return;
                }

                openFile(file);
                updateAppearance();
            }

        });
    }

    // clear recent
    mnFile.addSeparator();
    mnFile.add(new MyAction("Clear recent files", "Clear recent files", null, null, false, null) {

        @Override
        public void actionPerformed(ActionEvent e) {
            PreferencesManager.getSingleton().clearRecentFiles();
        }
    });

    // finally exit
    mnFile.addSeparator();
    JMenuItem item = mnFile.add(new MyAction("Exit", "Exit", null, null, false,
            KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.Event.CTRL_MASK)) {

        @Override
        public void actionPerformed(ActionEvent e) {
            dispose();
            System.exit(0);
        }
    });
    item.setAccelerator(((MyAction) item.getAction()).accelerator);
    mnFile.validate();
}

From source file:userinterface.properties.GUIGraphHandler.java

public void defineConstantsAndPlot(Expression expr, JPanel graph, String seriesName, Boolean isNewGraph,
        boolean is2D) {

    JDialog dialog;/*  w  w  w  .j ava  2  s.  c o  m*/
    JButton ok, cancel;
    JScrollPane scrollPane;
    ConstantPickerList constantList;
    JComboBox<String> xAxis, yAxis;

    //init everything
    dialog = new JDialog(GUIPrism.getGUI());
    dialog.setTitle("Define constants and select axes");
    dialog.setSize(500, 400);
    dialog.setLocationRelativeTo(GUIPrism.getGUI());
    dialog.setLayout(new BoxLayout(dialog.getContentPane(), BoxLayout.Y_AXIS));
    dialog.setModal(true);

    constantList = new ConstantPickerList();
    scrollPane = new JScrollPane(constantList);

    xAxis = new JComboBox<String>();
    yAxis = new JComboBox<String>();

    ok = new JButton("Ok");
    ok.setMnemonic('O');
    cancel = new JButton("Cancel");
    cancel.setMnemonic('C');

    //add all components to their dedicated panels
    JPanel exprPanel = new JPanel(new FlowLayout());
    exprPanel.setBorder(new TitledBorder("Function"));
    exprPanel.add(new JLabel(expr.toString()));

    JPanel axisPanel = new JPanel();
    axisPanel.setBorder(new TitledBorder("Select axis constants"));
    axisPanel.setLayout(new BoxLayout(axisPanel, BoxLayout.Y_AXIS));
    JPanel xAxisPanel = new JPanel(new FlowLayout());
    xAxisPanel.add(new JLabel("X axis:"));
    xAxisPanel.add(xAxis);
    JPanel yAxisPanel = new JPanel(new FlowLayout());
    yAxisPanel.add(new JLabel("Y axis:"));
    yAxisPanel.add(yAxis);
    axisPanel.add(xAxisPanel);
    axisPanel.add(yAxisPanel);

    JPanel constantPanel = new JPanel(new BorderLayout());
    constantPanel.setBorder(new TitledBorder("Please define the following constants"));
    constantPanel.add(scrollPane, BorderLayout.CENTER);
    constantPanel.add(new ConstantHeader(), BorderLayout.NORTH);

    JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    bottomPanel.add(ok);
    bottomPanel.add(cancel);

    //fill the axes components

    for (int i = 0; i < expr.getAllConstants().size(); i++) {

        xAxis.addItem(expr.getAllConstants().get(i));

        if (!is2D)
            yAxis.addItem(expr.getAllConstants().get(i));
    }

    if (!is2D) {
        yAxis.setSelectedIndex(1);
    }

    //fill the constants table

    for (int i = 0; i < expr.getAllConstants().size(); i++) {

        ConstantLine line = new ConstantLine(expr.getAllConstants().get(i), TypeDouble.getInstance());
        constantList.addConstant(line);

        if (!is2D) {
            if (line.getName().equals(xAxis.getSelectedItem().toString())
                    || line.getName().equals(yAxis.getSelectedItem().toString())) {

                line.doFuncEnables(false);
            } else {
                line.doFuncEnables(true);
            }
        }

    }

    //do enables

    if (is2D) {
        yAxis.setEnabled(false);
    }

    ok.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "ok");
    ok.getActionMap().put("ok", new AbstractAction() {

        @Override
        public void actionPerformed(ActionEvent e) {
            ok.doClick();
        }
    });

    cancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
            "cancel");
    cancel.getActionMap().put("cancel", new AbstractAction() {

        @Override
        public void actionPerformed(ActionEvent e) {
            cancel.doClick();
        }
    });

    //add action listeners

    xAxis.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {

            if (is2D) {
                return;
            }

            String item = xAxis.getSelectedItem().toString();

            if (item.equals(yAxis.getSelectedItem().toString())) {

                int index = yAxis.getSelectedIndex();

                if (index != yAxis.getItemCount() - 1) {
                    yAxis.setSelectedIndex(++index);
                } else {
                    yAxis.setSelectedIndex(--index);
                }

            }

            for (int i = 0; i < constantList.getNumConstants(); i++) {

                ConstantLine line = constantList.getConstantLine(i);

                if (line.getName().equals(xAxis.getSelectedItem().toString())
                        || line.getName().equals(yAxis.getSelectedItem().toString())) {

                    line.doFuncEnables(false);
                } else {

                    line.doFuncEnables(true);
                }

            }
        }
    });

    yAxis.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {

            String item = yAxis.getSelectedItem().toString();

            if (item.equals(xAxis.getSelectedItem().toString())) {

                int index = xAxis.getSelectedIndex();

                if (index != xAxis.getItemCount() - 1) {
                    xAxis.setSelectedIndex(++index);
                } else {
                    xAxis.setSelectedIndex(--index);
                }
            }

            for (int i = 0; i < constantList.getNumConstants(); i++) {

                ConstantLine line = constantList.getConstantLine(i);

                if (line.getName().equals(xAxis.getSelectedItem().toString())
                        || line.getName().equals(yAxis.getSelectedItem().toString())) {

                    line.doFuncEnables(false);
                } else {

                    line.doFuncEnables(true);
                }

            }
        }
    });

    ok.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {

            try {

                constantList.checkValid();

            } catch (PrismException e2) {
                JOptionPane.showMessageDialog(dialog,
                        "<html> One or more of the defined constants are invalid. <br><br> <font color=red>Error: </font>"
                                + e2.getMessage() + "</html>",
                        "Parse Error", JOptionPane.ERROR_MESSAGE);
                return;
            }

            if (is2D) {

                // it will always be a parametric graph in 2d case
                ParametricGraph pGraph = (ParametricGraph) graph;

                ConstantLine xAxisConstant = constantList.getConstantLine(xAxis.getSelectedItem().toString());

                if (xAxisConstant == null) {
                    //should never happen
                    JOptionPane.showMessageDialog(dialog, "The selected axis is invalid.", "Error",
                            JOptionPane.ERROR_MESSAGE);
                    return;
                }

                double xStartValue = Double.parseDouble(xAxisConstant.getStartValue());
                double xEndValue = Double.parseDouble(xAxisConstant.getEndValue());
                double xStepValue = Double.parseDouble(xAxisConstant.getStepValue());

                int seriesCount = 0;

                for (int i = 0; i < constantList.getNumConstants(); i++) {

                    ConstantLine line = constantList.getConstantLine(i);

                    if (line.getName().equals(xAxis.getSelectedItem().toString())) {
                        seriesCount++;
                    } else {

                        seriesCount += line.getTotalNumOfValues();

                    }
                }

                // if there will be too many series to be plotted, ask the user if they are sure they know what they are doing
                if (seriesCount > 10) {

                    int res = JOptionPane.showConfirmDialog(dialog,
                            "This configuration will create " + seriesCount + " series. Continue?", "Confirm",
                            JOptionPane.YES_NO_OPTION);

                    if (res == JOptionPane.NO_OPTION) {
                        return;
                    }

                }

                Values singleValuesGlobal = new Values();

                //add the single values to a global values list

                for (int i = 0; i < constantList.getNumConstants(); i++) {

                    ConstantLine line = constantList.getConstantLine(i);

                    if (line.getTotalNumOfValues() == 1) {

                        double singleValue = Double.parseDouble(line.getSingleValue());
                        singleValuesGlobal.addValue(line.getName(), singleValue);
                    }
                }

                // we just have one variable so we can plot directly
                if (constantList.getNumConstants() == 1
                        || singleValuesGlobal.getNumValues() == constantList.getNumConstants() - 1) {

                    SeriesKey key = pGraph.addSeries(seriesName);

                    pGraph.hideShape(key);
                    pGraph.getXAxisSettings().setHeading(xAxis.getSelectedItem().toString());
                    pGraph.getYAxisSettings().setHeading("function");

                    for (double x = xStartValue; x <= xEndValue; x += xStepValue) {

                        double ans = -1;

                        Values vals = new Values();
                        vals.addValue(xAxis.getSelectedItem().toString(), x);

                        for (int ii = 0; ii < singleValuesGlobal.getNumValues(); ii++) {

                            try {
                                vals.addValue(singleValuesGlobal.getName(ii),
                                        singleValuesGlobal.getDoubleValue(ii));
                            } catch (PrismLangException e1) {
                                e1.printStackTrace();
                            }

                        }

                        try {
                            ans = expr.evaluateDouble(vals);
                        } catch (PrismLangException e1) {
                            e1.printStackTrace();
                        }

                        pGraph.addPointToSeries(key, new PrismXYDataItem(x, ans));

                    }

                    if (isNewGraph) {
                        addGraph(pGraph);
                    }

                    dialog.dispose();
                    return;
                }

                for (int i = 0; i < constantList.getNumConstants(); i++) {

                    ConstantLine line = constantList.getConstantLine(i);

                    if (line == xAxisConstant || singleValuesGlobal.contains(line.getName())) {
                        continue;
                    }

                    double lineStart = Double.parseDouble(line.getStartValue());
                    double lineEnd = Double.parseDouble(line.getEndValue());
                    double lineStep = Double.parseDouble(line.getStepValue());

                    for (double j = lineStart; j < lineEnd; j += lineStep) {

                        SeriesKey key = pGraph.addSeries(seriesName);
                        pGraph.hideShape(key);

                        for (double x = xStartValue; x <= xEndValue; x += xStepValue) {

                            double ans = -1;

                            Values vals = new Values();
                            vals.addValue(xAxis.getSelectedItem().toString(), x);
                            vals.addValue(line.getName(), j);

                            for (int ii = 0; ii < singleValuesGlobal.getNumValues(); ii++) {

                                try {
                                    vals.addValue(singleValuesGlobal.getName(ii),
                                            singleValuesGlobal.getDoubleValue(ii));
                                } catch (PrismLangException e1) {
                                    // TODO Auto-generated catch block
                                    e1.printStackTrace();
                                }

                            }

                            for (int ii = 0; ii < constantList.getNumConstants(); ii++) {

                                if (constantList.getConstantLine(ii) == xAxisConstant
                                        || singleValuesGlobal
                                                .contains(constantList.getConstantLine(ii).getName())
                                        || constantList.getConstantLine(ii) == line) {

                                    continue;
                                }

                                ConstantLine temp = constantList.getConstantLine(ii);
                                double val = Double.parseDouble(temp.getStartValue());

                                vals.addValue(temp.getName(), val);
                            }

                            try {
                                ans = expr.evaluateDouble(vals);
                            } catch (PrismLangException e1) {
                                e1.printStackTrace();
                            }

                            pGraph.addPointToSeries(key, new PrismXYDataItem(x, ans));
                        }
                    }

                }

                if (isNewGraph) {
                    addGraph(graph);
                }
            } else {

                // this will always be a parametric graph for the 3d case
                ParametricGraph3D pGraph = (ParametricGraph3D) graph;

                //add the graph to the gui
                addGraph(pGraph);

                //Get the constants we want to put on the x and y axis
                ConstantLine xAxisConstant = constantList.getConstantLine(xAxis.getSelectedItem().toString());
                ConstantLine yAxisConstant = constantList.getConstantLine(yAxis.getSelectedItem().toString());

                //add the single values to a global values list

                Values singleValuesGlobal = new Values();

                for (int i = 0; i < constantList.getNumConstants(); i++) {

                    ConstantLine line = constantList.getConstantLine(i);

                    if (line.getTotalNumOfValues() == 1) {

                        double singleValue = Double.parseDouble(line.getSingleValue());
                        singleValuesGlobal.addValue(line.getName(), singleValue);
                    }
                }

                pGraph.setGlobalValues(singleValuesGlobal);
                pGraph.setAxisConstants(xAxis.getSelectedItem().toString(), yAxis.getSelectedItem().toString());
                pGraph.setBounds(xAxisConstant.getStartValue(), xAxisConstant.getEndValue(),
                        yAxisConstant.getStartValue(), yAxisConstant.getEndValue());

                SwingUtilities.invokeLater(new Runnable() {

                    @Override
                    public void run() {
                        //plot the graph
                        pGraph.plot(expr.toString(), xAxis.getSelectedItem().toString(), "Function",
                                yAxis.getSelectedItem().toString());

                        //calculate the sampling rates from the step sizes as given by the user

                        int xSamples = (int) ((Double.parseDouble(xAxisConstant.getEndValue())
                                - Double.parseDouble(xAxisConstant.getStartValue()))
                                / Double.parseDouble(xAxisConstant.getStepValue()));
                        int ySamples = (int) ((Double.parseDouble(xAxisConstant.getEndValue())
                                - Double.parseDouble(xAxisConstant.getStartValue()))
                                / Double.parseDouble(xAxisConstant.getStepValue()));

                        pGraph.setSamplingRates(xSamples, ySamples);
                    }
                });

            }

            dialog.dispose();
        }
    });

    cancel.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            dialog.dispose();
        }
    });

    //add everything to the dialog show the dialog

    dialog.add(exprPanel);
    dialog.add(axisPanel);
    dialog.add(constantPanel);
    dialog.add(bottomPanel);
    dialog.setVisible(true);

}

From source file:de.codesourcery.jasm16.ide.ui.views.SourceCodeView.java

protected final void setupKeyBindings(final JTextPane editor) {
    // 'Save' action 
    addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK), new AbstractAction() {
        @Override//from ww w  .  j a  v a 2  s  .  co m
        public void actionPerformed(ActionEvent e) {
            saveCurrentFile();
        }
    });

    // 'Underline text when pressing CTRL while hovering over an identifier' 
    editorPane.addKeyListener(new KeyAdapter() {
        private boolean isControlKey(KeyEvent e) {
            return e.getKeyCode() == KeyEvent.VK_CONTROL;
        }

        public void keyPressed(KeyEvent e) {
            if (isControlKey(e)) {
                final Point ptr = getMouseLocation();
                if (ptr != null) {
                    maybeUnderlineIdentifierAt(ptr);
                }
            }
        }

        public void keyReleased(KeyEvent e) {
            if (isControlKey(e)) {
                clearUnderlineHighlight();
            }
        };
    });

    // "Undo" action
    addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_Z, Event.CTRL_MASK), undoAction);

    addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_Y, Event.CTRL_MASK), redoAction);

    // 'Search' action 
    addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK), new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            showSearchDialog();
        }
    });

    setupKeyBindingsHook(editor);
}

From source file:library.Form_Library.java

License:asdf

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.// w  w w.  j  a  v  a2  s  .c  o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel1 = new javax.swing.JPanel();
    jLabel20 = new javax.swing.JLabel();
    jPanel19 = new javax.swing.JPanel();
    jButton10 = new javax.swing.JButton();
    jButton11 = new javax.swing.JButton();
    jButton12 = new javax.swing.JButton();
    jPanel20 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    jTabbedPane2 = new javax.swing.JTabbedPane();
    jPanel7 = new javax.swing.JPanel();
    jPanel11 = new javax.swing.JPanel();
    lbBookID = new javax.swing.JLabel();
    lbSupplierID = new javax.swing.JLabel();
    lbBookName = new javax.swing.JLabel();
    lbPrice = new javax.swing.JLabel();
    lbCategoryID = new javax.swing.JLabel();
    tfBookID = new javax.swing.JTextField();
    tfBookName = new javax.swing.JTextField();
    tfPrice = new javax.swing.JTextField();
    lbColumnNo = new javax.swing.JLabel();
    lbAuthorID = new javax.swing.JLabel();
    lbShelf = new javax.swing.JLabel();
    lbQuantity = new javax.swing.JLabel();
    lbRowNo = new javax.swing.JLabel();
    cbCategoryID = new javax.swing.JComboBox<>();
    tfColumnNo = new javax.swing.JTextField();
    tfQuantity = new javax.swing.JTextField();
    tfShelf = new javax.swing.JTextField();
    tfRowNo = new javax.swing.JTextField();
    tfAuthorID = new javax.swing.JTextField();
    tfSupplierID = new javax.swing.JTextField();
    lbImage = new javax.swing.JLabel();
    btImage = new javax.swing.JButton();
    tfImage = new javax.swing.JTextField();
    btAdd1 = new javax.swing.JButton();
    btEdit1 = new javax.swing.JButton();
    btDelete1 = new javax.swing.JButton();
    btClose = new javax.swing.JButton();
    jScrollPane3 = new javax.swing.JScrollPane();
    tbBookAdmin = new javax.swing.JTable();
    tfSearchBook = new javax.swing.JTextField();
    btSearchBook = new javax.swing.JButton();
    lbSupplierID2 = new javax.swing.JLabel();
    tfPublisherofBook = new javax.swing.JTextField();
    jButton4 = new javax.swing.JButton();
    jButton5 = new javax.swing.JButton();
    btSave = new javax.swing.JButton();
    jButton133 = new javax.swing.JButton();
    jPanel9 = new javax.swing.JPanel();
    jLabel16 = new javax.swing.JLabel();
    tfcategoryid = new javax.swing.JTextField();
    jLabel17 = new javax.swing.JLabel();
    tfcategoryname = new javax.swing.JTextField();
    btadd = new javax.swing.JButton();
    btupdate = new javax.swing.JButton();
    btdelete = new javax.swing.JButton();
    jScrollPane5 = new javax.swing.JScrollPane();
    tbcategory = new javax.swing.JTable();
    btdelete1 = new javax.swing.JButton();
    jPanel8 = new javax.swing.JPanel();
    jPanel12 = new javax.swing.JPanel();
    btAdd2 = new javax.swing.JButton();
    btEdit2 = new javax.swing.JButton();
    btDelete2 = new javax.swing.JButton();
    jScrollPane4 = new javax.swing.JScrollPane();
    tbAuthorAdmin = new javax.swing.JTable();
    lbAuthorID1 = new javax.swing.JLabel();
    tfAuthorID1 = new javax.swing.JTextField();
    lbAuthorName = new javax.swing.JLabel();
    tfAuthorName = new javax.swing.JTextField();
    btClose1 = new javax.swing.JButton();
    jPanel10 = new javax.swing.JPanel();
    jPanel13 = new javax.swing.JPanel();
    btAddPublisher = new javax.swing.JButton();
    btEditPublisher = new javax.swing.JButton();
    btDeletePublisher = new javax.swing.JButton();
    btClose2 = new javax.swing.JButton();
    jScrollPane6 = new javax.swing.JScrollPane();
    tbPublisher = new javax.swing.JTable();
    lbAuthorID2 = new javax.swing.JLabel();
    tfPublisherID = new javax.swing.JTextField();
    lbAuthorName1 = new javax.swing.JLabel();
    tfPublisherName = new javax.swing.JTextField();
    jPanel3 = new javax.swing.JPanel();
    tfName = new javax.swing.JTextField();
    tfID = new javax.swing.JTextField();
    tfIDCardNumber = new javax.swing.JTextField();
    tfEmail = new javax.swing.JTextField();
    tfAddress = new javax.swing.JTextField();
    tfPhone = new javax.swing.JTextField();
    cbSex = new javax.swing.JComboBox<>();
    carBirthday = new com.toedter.calendar.JDateChooser();
    carActivationDate = new com.toedter.calendar.JDateChooser();
    carExpiredDate = new com.toedter.calendar.JDateChooser();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jLabel9 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    jLabel12 = new javax.swing.JLabel();
    jLabel13 = new javax.swing.JLabel();
    jLabel14 = new javax.swing.JLabel();
    jLabel15 = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    tbReader = new javax.swing.JTable();
    btnAdd = new javax.swing.JButton();
    btnEdit = new javax.swing.JButton();
    btnDelete = new javax.swing.JButton();
    btnSearch = new javax.swing.JButton();
    tfSearch = new javax.swing.JTextField();
    btnSearch1 = new javax.swing.JButton();
    jScrollPane11 = new javax.swing.JScrollPane();
    taPrintReader = new javax.swing.JTextArea();
    btPrintReader = new javax.swing.JButton();
    lbImageLink = new javax.swing.JLabel();
    btSaveReader = new javax.swing.JButton();
    tfImageLink = new javax.swing.JTextField();
    btBrowseReader = new javax.swing.JButton();
    jPanel4 = new javax.swing.JPanel();
    jTabbedPane3 = new javax.swing.JTabbedPane();
    jPanel15 = new javax.swing.JPanel();
    tfBorrowID = new javax.swing.JTextField();
    tfBookBMID = new javax.swing.JTextField();
    tfReaderID = new javax.swing.JTextField();
    carBorrowDate = new com.toedter.calendar.JDateChooser();
    jLabel1 = new javax.swing.JLabel();
    carReturnDate = new com.toedter.calendar.JDateChooser();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    tbBorrowingManagement = new javax.swing.JTable();
    jPanel18 = new javax.swing.JPanel();
    btEdit = new javax.swing.JButton();
    btDelete3 = new javax.swing.JButton();
    btDelete = new javax.swing.JButton();
    btAdd = new javax.swing.JButton();
    jButton9 = new javax.swing.JButton();
    jPanel16 = new javax.swing.JPanel();
    tfSearchReturn = new javax.swing.JTextField();
    btSearchReturn = new javax.swing.JButton();
    jScrollPane8 = new javax.swing.JScrollPane();
    tbReturn = new javax.swing.JTable();
    jLabel18 = new javax.swing.JLabel();
    jLabel19 = new javax.swing.JLabel();
    jButton8 = new javax.swing.JButton();
    jPanel5 = new javax.swing.JPanel();
    jPanel14 = new javax.swing.JPanel();
    lbSupplierID1 = new javax.swing.JLabel();
    lbSupplierName = new javax.swing.JLabel();
    tfSupplierID1 = new javax.swing.JTextField();
    tfSupplierName = new javax.swing.JTextField();
    lbPhone = new javax.swing.JLabel();
    ftfPhoneSupplier = new javax.swing.JFormattedTextField();
    lbAddress = new javax.swing.JLabel();
    tfAddressSuplier = new javax.swing.JTextField();
    jScrollPane7 = new javax.swing.JScrollPane();
    tbSupplierAdmin = new javax.swing.JTable();
    jPanel17 = new javax.swing.JPanel();
    btEditSupplier = new javax.swing.JButton();
    btDeleteSupplier = new javax.swing.JButton();
    btClose3 = new javax.swing.JButton();
    btAddSupplier = new javax.swing.JButton();
    jPanel6 = new javax.swing.JPanel();
    jLabel21 = new javax.swing.JLabel();
    jLabel22 = new javax.swing.JLabel();
    jScrollPane9 = new javax.swing.JScrollPane();
    tbPhieuQuaHan = new javax.swing.JTable();
    jLabel23 = new javax.swing.JLabel();
    lbTongSach = new javax.swing.JLabel();
    lbTongPhieu = new javax.swing.JLabel();
    lbTongKhachMuon = new javax.swing.JLabel();
    lbTongKhach = new javax.swing.JLabel();
    lbTongPhieuQuaHan = new javax.swing.JLabel();
    btPrintStas = new javax.swing.JButton();
    jScrollPane10 = new javax.swing.JScrollPane();
    taBaoCao = new javax.swing.JTextArea();
    jButton6 = new javax.swing.JButton();
    jButton7 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setLocationByPlatform(true);
    setResizable(false);
    addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyPressed(java.awt.event.KeyEvent evt) {
            formKeyPressed(evt);
        }
    });

    jPanel1.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyPressed(java.awt.event.KeyEvent evt) {
            jPanel1KeyPressed(evt);
        }
    });

    jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/vnflag.png"))); // NOI18N
    java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("resources/Bundle"); // NOI18N
    jButton10.setText(bundle.getString("Form_Library.jButton10.text")); // NOI18N
    jButton10.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton10ActionPerformed(evt);
        }
    });

    jButton11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/US.png"))); // NOI18N
    jButton11.setText(bundle.getString("Form_Library.jButton11.text")); // NOI18N
    jButton11.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton11ActionPerformed(evt);
        }
    });

    jButton12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/japan-flag-icon.png"))); // NOI18N
    jButton12.setText(bundle.getString("Form_Library.jButton12.text")); // NOI18N
    jButton12.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton12ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
    jPanel19.setLayout(jPanel19Layout);
    jPanel19Layout.setHorizontalGroup(jPanel19Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 373, Short.MAX_VALUE)
            .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel19Layout.createSequentialGroup().addContainerGap().addComponent(jButton10)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton11)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton12)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))));
    jPanel19Layout.setVerticalGroup(jPanel19Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)
            .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel19Layout.createSequentialGroup().addContainerGap().addGroup(jPanel19Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton11, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
                            .addComponent(jButton12, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
                            .addComponent(jButton10, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))));

    jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/key.png"))); // NOI18N
    jButton1.setMnemonic('C');
    jButton1.setText(bundle.getString("Form_Library.jButton1.text")); // NOI18N
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/logout.png"))); // NOI18N
    jButton2.setMnemonic('L');
    jButton2.setText(bundle.getString("Form_Library.jButton2.text")); // NOI18N
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });

    jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/home.png"))); // NOI18N
    jButton3.setMnemonic('H');
    jButton3.setText(bundle.getString("Form_Library.jButton3.text")); // NOI18N
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
    jPanel20.setLayout(jPanel20Layout);
    jPanel20Layout
            .setHorizontalGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel20Layout.createSequentialGroup().addContainerGap()
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 160,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 159,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 160,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel20Layout.setVerticalGroup(jPanel20Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
                            .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap()));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 114,
                                    Short.MAX_VALUE)
                            .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(93, 93, 93)))));
    jPanel1Layout
            .setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jPanel19, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel20, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 592,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap(99, Short.MAX_VALUE)));

    jTabbedPane1.addTab(bundle.getString("Form_Library.jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

    lbBookID.setText(bundle.getString("Form_Library.lbBookID.text")); // NOI18N

    lbSupplierID.setText(bundle.getString("Form_Library.lbSupplierID.text")); // NOI18N

    lbBookName.setText(bundle.getString("Form_Library.lbBookName.text")); // NOI18N

    lbPrice.setText(bundle.getString("Form_Library.lbPrice.text")); // NOI18N

    lbCategoryID.setText(bundle.getString("Form_Library.lbCategoryID.text")); // NOI18N

    tfBookID.setEditable(false);

    tfBookName.setEditable(false);

    tfPrice.setEditable(false);

    lbColumnNo.setText(bundle.getString("Form_Library.lbColumnNo.text")); // NOI18N

    lbAuthorID.setText(bundle.getString("Form_Library.lbAuthorID.text")); // NOI18N

    lbShelf.setText(bundle.getString("Form_Library.lbShelf.text")); // NOI18N

    lbQuantity.setText(bundle.getString("Form_Library.lbQuantity.text")); // NOI18N

    lbRowNo.setText(bundle.getString("Form_Library.lbRowNo.text")); // NOI18N

    cbCategoryID.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "--CategoryID--" }));
    cbCategoryID.setEnabled(false);

    tfColumnNo.setEditable(false);

    tfQuantity.setEditable(false);

    tfShelf.setEditable(false);

    tfRowNo.setEditable(false);

    tfAuthorID.setEditable(false);

    tfSupplierID.setEditable(false);

    lbImage.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED,
            java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white));

    btImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Pictures Folder-20.png"))); // NOI18N
    btImage.setText(bundle.getString("Form_Library.btImage.text")); // NOI18N
    btImage.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btImageActionPerformed(evt);
        }
    });

    tfImage.setEditable(false);

    btAdd1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_add.png"))); // NOI18N
    btAdd1.setMnemonic('A');
    btAdd1.setText(bundle.getString("Form_Library.btAdd1.text")); // NOI18N
    btAdd1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btAdd1ActionPerformed(evt);
        }
    });

    btEdit1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    btEdit1.setMnemonic('U');
    btEdit1.setText(bundle.getString("Form_Library.btEdit1.text")); // NOI18N
    btEdit1.setMaximumSize(new java.awt.Dimension(63, 23));
    btEdit1.setMinimumSize(new java.awt.Dimension(63, 23));
    btEdit1.setPreferredSize(new java.awt.Dimension(63, 23));
    btEdit1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btEdit1ActionPerformed(evt);
        }
    });

    btDelete1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_delete.png"))); // NOI18N
    btDelete1.setMnemonic('D');
    btDelete1.setText(bundle.getString("Form_Library.btDelete1.text")); // NOI18N
    btDelete1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btDelete1ActionPerformed(evt);
        }
    });

    btClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Redo-16.png"))); // NOI18N
    btClose.setMnemonic('C');
    btClose.setText(bundle.getString("Form_Library.btClose.text")); // NOI18N
    btClose.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btCloseActionPerformed(evt);
        }
    });

    tbBookAdmin
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    tbBookAdmin.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN);
    tbBookAdmin.setName(""); // NOI18N
    tbBookAdmin.setAutoCreateRowSorter(true);
    tbBookAdmin.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tbBookAdminMouseClicked(evt);
        }
    });
    jScrollPane3.setViewportView(tbBookAdmin);

    btSearchBook.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_search.png"))); // NOI18N
    btSearchBook.setMnemonic('S');
    btSearchBook.setText(bundle.getString("Form_Library.btSearchBook.text")); // NOI18N
    btSearchBook.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btSearchBookActionPerformed(evt);
        }
    });

    lbSupplierID2.setText(bundle.getString("Form_Library.lbSupplierID2.text")); // NOI18N

    tfPublisherofBook.setEditable(false);

    jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Export-16 (1).png"))); // NOI18N
    jButton4.setText(bundle.getString("Form_Library.jButton4.text")); // NOI18N
    jButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });

    jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Import-16 (1).png"))); // NOI18N
    jButton5.setText(bundle.getString("Form_Library.jButton5.text")); // NOI18N
    jButton5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
        }
    });

    btSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Save-16.png"))); // NOI18N
    btSave.setText(bundle.getString("Form_Library.btSave.text")); // NOI18N
    btSave.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btSaveActionPerformed(evt);
        }
    });

    jButton133.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    Action buttonActionBook = new AbstractAction("",
            new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))) {

        @Override
        public void actionPerformed(ActionEvent evt) {
            BookList.getList().clear();
            dmBook.getDataVector().clear();
            BookList.load("select * from book");
            for (Book c : BookList.getList()) {
                dmBook.addRow(c.toVector());
            }
        }
    };

    String keyBook = "";

    jButton133.setAction(buttonActionBook);

    buttonActionBook.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_R);

    jButton133.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0),
            keyBook);

    jButton133.getActionMap().put(keyBook, buttonActionBook);
    jButton133.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton133ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
    jPanel11.setLayout(jPanel11Layout);
    jPanel11Layout.setHorizontalGroup(jPanel11Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup().addGap(20, 20, 20).addGroup(jPanel11Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel11Layout
                            .createSequentialGroup().addGroup(jPanel11Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel11Layout.createSequentialGroup().addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 128,
                                                    Short.MAX_VALUE)
                                            .addComponent(
                                                    btAdd1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(jPanel11Layout.createParallelGroup(
                                                    javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                                                            jPanel11Layout.createSequentialGroup().addComponent(
                                                                    jButton4,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 131,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                    .addGap(0, 0, Short.MAX_VALUE))
                                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                                            .addComponent(btEdit1,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 131,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(
                                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(btDelete1,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(
                                                                    javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                                    29, Short.MAX_VALUE)
                                                            .addComponent(btSave,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 91,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addComponent(tfSearchBook))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel11Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(btClose, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btSearchBook, javax.swing.GroupLayout.DEFAULT_SIZE, 130,
                                            Short.MAX_VALUE)))
                    .addGroup(jPanel11Layout.createSequentialGroup().addGroup(jPanel11Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel11Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(tfSupplierID, javax.swing.GroupLayout.PREFERRED_SIZE, 190,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel11Layout.createSequentialGroup().addComponent(lbSupplierID2)
                                            .addGap(18, 18, 18).addComponent(tfPublisherofBook,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 190,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel11Layout.createSequentialGroup().addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lbBookName)
                                            .addComponent(lbBookID, javax.swing.GroupLayout.PREFERRED_SIZE, 51,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lbAuthorID)).addGap(18, 18, 18)
                                            .addGroup(jPanel11Layout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING, false)
                                                    .addComponent(tfAuthorID,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE, 191,
                                                            Short.MAX_VALUE)
                                                    .addComponent(tfBookID).addComponent(tfBookName))))
                            .addComponent(lbSupplierID, javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                    jPanel11Layout.createSequentialGroup().addComponent(lbCategoryID).addGap(18,
                                            18, 18).addComponent(cbCategoryID,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 188,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel11Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel11Layout
                                            .createSequentialGroup().addGap(4, 4, 4)
                                            .addGroup(jPanel11Layout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(lbRowNo,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 76,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                                            .addGroup(jPanel11Layout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                                    .addComponent(lbQuantity)
                                                                    .addComponent(
                                                                            lbPrice)
                                                                    .addComponent(lbShelf))
                                                            .addGap(28, 28, 28)
                                                            .addGroup(jPanel11Layout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                                    false).addComponent(tfQuantity)
                                                                    .addComponent(tfShelf).addComponent(tfPrice,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                            190,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE)))))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                            jPanel11Layout.createSequentialGroup().addGroup(jPanel11Layout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING, false)
                                                    .addComponent(btImage, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                            jPanel11Layout.createSequentialGroup()
                                                                    .addGap(4, 4, 4).addComponent(lbColumnNo,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                            87,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addComponent(jButton133,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE))
                                                    .addGap(47, 47, 47)
                                                    .addGroup(jPanel11Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(tfColumnNo,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 130,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(tfImage,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 130,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(tfRowNo,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 130,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))))
                    .addGap(111, 111, 111)
                    .addComponent(lbImage, javax.swing.GroupLayout.PREFERRED_SIZE, 200,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(48, 48, 48))
            .addGroup(jPanel11Layout.createSequentialGroup()
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1066, Short.MAX_VALUE)
                    .addContainerGap()));
    jPanel11Layout.setVerticalGroup(jPanel11Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                    .addComponent(lbImage, javax.swing.GroupLayout.PREFERRED_SIZE, 300,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(33, 33, 33))
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                    .addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(tfBookID)
                                            .addComponent(lbBookID, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(lbPrice).addComponent(tfPrice))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(tfBookName)
                                            .addComponent(lbBookName, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(lbQuantity).addComponent(tfQuantity))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(lbAuthorID, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(tfAuthorID)
                                            .addComponent(lbShelf, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(tfShelf))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(lbSupplierID2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(tfPublisherofBook)
                                            .addComponent(lbRowNo, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(tfRowNo, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(7, 7, 7)
                                    .addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(lbSupplierID, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(tfSupplierID).addComponent(lbColumnNo)
                                            .addComponent(tfColumnNo))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(lbCategoryID)
                                            .addComponent(cbCategoryID, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(btImage).addComponent(tfImage,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGroup(jPanel11Layout.createSequentialGroup()
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jButton133)))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel11Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel11Layout.createSequentialGroup()
                                                    .addGroup(jPanel11Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                                    false)
                                                            .addComponent(btAdd1,
                                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE, 26,
                                                                    Short.MAX_VALUE)
                                                            .addComponent(btEdit1,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    Short.MAX_VALUE)
                                                            .addGroup(jPanel11Layout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                                    .addComponent(btDelete1,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            Short.MAX_VALUE)
                                                                    .addComponent(btSave,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            Short.MAX_VALUE)))
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(tfSearchBook,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanel11Layout.createSequentialGroup().addGap(1, 1, 1)
                                                    .addComponent(btClose,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(btSearchBook)))
                                    .addGap(79, 79, 79)))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 251,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(116, 116, 116)));

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(jPanel7Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addComponent(jPanel11,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addComponent(jPanel11,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));

    jTabbedPane2.addTab(bundle.getString("Form_Library.jPanel7.TabConstraints.tabTitle"), jPanel7); // NOI18N

    jLabel16.setText(bundle.getString("Form_Library.jLabel16.text")); // NOI18N

    tfcategoryid.setEditable(false);

    jLabel17.setText(bundle.getString("Form_Library.jLabel17.text")); // NOI18N

    btadd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_add.png"))); // NOI18N
    btadd.setMnemonic('A');
    btadd.setText(bundle.getString("Form_Library.btadd.text")); // NOI18N
    btadd.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btaddActionPerformed(evt);
        }
    });

    btupdate.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    btupdate.setMnemonic('U');
    btupdate.setText(bundle.getString("Form_Library.btupdate.text")); // NOI18N
    btupdate.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btupdateActionPerformed(evt);
        }
    });

    btdelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_delete.png"))); // NOI18N
    btdelete.setMnemonic('D');
    btdelete.setText(bundle.getString("Form_Library.btdelete.text")); // NOI18N
    btdelete.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btdeleteActionPerformed(evt);
        }
    });

    tbcategory.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null }, { null, null }, { null, null }, { null, null } },
            new String[] { "Category ID", "Category Name" }));
    tbcategory.setAutoCreateRowSorter(true);
    tbcategory.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tbcategoryMouseClicked(evt);
        }
    });
    jScrollPane5.setViewportView(tbcategory);

    btdelete1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Redo-16.png"))); // NOI18N
    btdelete1.setMnemonic('C');
    btdelete1.setText(bundle.getString("Form_Library.btdelete1.text")); // NOI18N
    btdelete1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btdelete1ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(jPanel9Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup().addGap(41, 41, 41).addGroup(jPanel9Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                            .addComponent(btadd, javax.swing.GroupLayout.PREFERRED_SIZE, 130,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(btupdate, javax.swing.GroupLayout.PREFERRED_SIZE, 127,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18).addComponent(btdelete, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    126, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel9Layout.createSequentialGroup().addComponent(jLabel16).addGap(18, 18, 18)
                            .addComponent(tfcategoryid, javax.swing.GroupLayout.PREFERRED_SIZE, 190,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 143, Short.MAX_VALUE)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btdelete1, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 126,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel9Layout.createSequentialGroup().addComponent(jLabel17)
                                            .addGap(18, 18, 18).addComponent(tfcategoryname,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 363,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(45, 45, 45))
            .addGroup(jPanel9Layout.createSequentialGroup().addContainerGap().addComponent(jScrollPane5)
                    .addContainerGap()));
    jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup().addGap(31, 31, 31).addGroup(jPanel9Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel16)
                    .addComponent(tfcategoryid, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17).addComponent(tfcategoryname, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(25, 25, 25)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btadd, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btupdate, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btdelete, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btdelete1))
                    .addGap(18, 18, 18)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 614, Short.MAX_VALUE)));

    jTabbedPane2.addTab(bundle.getString("Form_Library.jPanel9.TabConstraints.tabTitle"), jPanel9); // NOI18N

    btAdd2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_add.png"))); // NOI18N
    btAdd2.setMnemonic('A');
    btAdd2.setText(bundle.getString("Form_Library.btAdd2.text")); // NOI18N
    btAdd2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btAdd2ActionPerformed(evt);
        }
    });

    btEdit2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    btEdit2.setMnemonic('U');
    btEdit2.setText(bundle.getString("Form_Library.btEdit2.text")); // NOI18N
    btEdit2.setMaximumSize(new java.awt.Dimension(63, 23));
    btEdit2.setMinimumSize(new java.awt.Dimension(63, 23));
    btEdit2.setPreferredSize(new java.awt.Dimension(63, 23));
    btEdit2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btEdit2ActionPerformed(evt);
        }
    });

    btDelete2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_delete.png"))); // NOI18N
    btDelete2.setMnemonic('D');
    btDelete2.setText(bundle.getString("Form_Library.btDelete2.text")); // NOI18N
    btDelete2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btDelete2ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
    jPanel12.setLayout(jPanel12Layout);
    jPanel12Layout
            .setHorizontalGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup().addGap(31, 31, 31)
                            .addComponent(btAdd2, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(btEdit2, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(btDelete2, javax.swing.GroupLayout.PREFERRED_SIZE, 126,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel12Layout.setVerticalGroup(jPanel12Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btAdd2, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btEdit2, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btDelete2)));

    tbAuthorAdmin
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    tbAuthorAdmin.setColumnSelectionAllowed(true);
    tbAuthorAdmin.setName(""); // NOI18N
    tbAuthorAdmin.setAutoCreateRowSorter(true);
    tbAuthorAdmin.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tbAuthorAdminMouseClicked(evt);
        }
    });
    jScrollPane4.setViewportView(tbAuthorAdmin);

    lbAuthorID1.setText(bundle.getString("Form_Library.lbAuthorID1.text")); // NOI18N

    tfAuthorID1.setEditable(false);

    lbAuthorName.setText(bundle.getString("Form_Library.lbAuthorName.text")); // NOI18N

    btClose1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Redo-16.png"))); // NOI18N
    btClose1.setMnemonic('C');
    btClose1.setText(bundle.getString("Form_Library.btClose1.text")); // NOI18N
    btClose1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btClose1ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout
            .setHorizontalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup().addGap(40, 40, 40)
                            .addComponent(lbAuthorID1, javax.swing.GroupLayout.PREFERRED_SIZE, 69,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(tfAuthorID1, javax.swing.GroupLayout.PREFERRED_SIZE, 187,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lbAuthorName).addGap(18, 18, 18)
                            .addComponent(tfAuthorName, javax.swing.GroupLayout.PREFERRED_SIZE, 324,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(57, 57, 57))
                    .addGroup(jPanel8Layout.createSequentialGroup().addContainerGap()
                            .addGroup(jPanel8Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel8Layout.createSequentialGroup().addComponent(jScrollPane4)
                                            .addContainerGap())
                                    .addGroup(jPanel8Layout.createSequentialGroup()
                                            .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGap(39, 39, 39)
                                            .addComponent(btClose1, javax.swing.GroupLayout.PREFERRED_SIZE, 123,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(491, Short.MAX_VALUE)))));
    jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup().addGap(35, 35, 35)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbAuthorID1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tfAuthorID1)
                            .addComponent(lbAuthorName, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tfAuthorName))
                    .addGap(18, 18, 18)
                    .addGroup(
                            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(btClose1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(18, 18, 18).addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 515,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    jTabbedPane2.addTab(bundle.getString("Form_Library.jPanel8.TabConstraints.tabTitle"), jPanel8); // NOI18N

    btAddPublisher.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_add.png"))); // NOI18N
    btAddPublisher.setMnemonic('A');
    btAddPublisher.setText(bundle.getString("Form_Library.btAddPublisher.text")); // NOI18N
    btAddPublisher.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btAddPublisherActionPerformed(evt);
        }
    });

    btEditPublisher.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    btEditPublisher.setMnemonic('U');
    btEditPublisher.setText(bundle.getString("Form_Library.btEditPublisher.text")); // NOI18N
    btEditPublisher.setMaximumSize(new java.awt.Dimension(63, 23));
    btEditPublisher.setMinimumSize(new java.awt.Dimension(63, 23));
    btEditPublisher.setPreferredSize(new java.awt.Dimension(63, 23));
    btEditPublisher.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btEditPublisherActionPerformed(evt);
        }
    });

    btDeletePublisher.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_delete.png"))); // NOI18N
    btDeletePublisher.setMnemonic('D');
    btDeletePublisher.setText(bundle.getString("Form_Library.btDeletePublisher.text")); // NOI18N
    btDeletePublisher.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btDeletePublisherActionPerformed(evt);
        }
    });

    btClose2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Redo-16.png"))); // NOI18N
    btClose2.setMnemonic('C');
    btClose2.setText(bundle.getString("Form_Library.btClose2.text")); // NOI18N
    btClose2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btClose2ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
    jPanel13.setLayout(jPanel13Layout);
    jPanel13Layout.setHorizontalGroup(jPanel13Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup().addGap(29, 29, 29)
                    .addComponent(btAddPublisher, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(btEditPublisher, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(btDeletePublisher, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(460, 460, 460).addComponent(btClose2, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(51, Short.MAX_VALUE)));
    jPanel13Layout
            .setVerticalGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btAddPublisher, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btEditPublisher, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btDeletePublisher, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btClose2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jScrollPane6.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jScrollPane6MouseClicked(evt);
        }
    });

    tbPublisher
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    tbPublisher.setColumnSelectionAllowed(true);
    tbPublisher.setAutoCreateRowSorter(true);
    tbPublisher.setName(""); // NOI18N
    tbPublisher.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tbPublisherMouseClicked(evt);
        }
    });
    jScrollPane6.setViewportView(tbPublisher);
    tbPublisher.getColumnModel().getSelectionModel()
            .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);

    lbAuthorID2.setText(bundle.getString("Form_Library.lbAuthorID2.text")); // NOI18N

    tfPublisherID.setEditable(false);

    lbAuthorName1.setText(bundle.getString("Form_Library.lbAuthorName1.text")); // NOI18N

    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(jPanel10Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup().addGroup(jPanel10Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createSequentialGroup().addContainerGap().addGroup(jPanel10Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.TRAILING)))
                    .addGroup(jPanel10Layout.createSequentialGroup().addGap(39, 39, 39)
                            .addComponent(lbAuthorID2, javax.swing.GroupLayout.PREFERRED_SIZE, 69,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(tfPublisherID, javax.swing.GroupLayout.PREFERRED_SIZE, 180,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lbAuthorName1).addGap(29, 29, 29).addComponent(tfPublisherName,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 339,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    jPanel10Layout.setVerticalGroup(jPanel10Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup().addGap(38, 38, 38)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbAuthorID2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tfPublisherID)
                            .addComponent(lbAuthorName1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tfPublisherName))
                    .addGap(18, 18, 18)
                    .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18).addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 515,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    jTabbedPane2.addTab(bundle.getString("Form_Library.jPanel10.TabConstraints.tabTitle"), jPanel10); // NOI18N

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout
            .setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTabbedPane2, javax.swing.GroupLayout.Alignment.TRAILING));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane2));

    jTabbedPane1.addTab(bundle.getString("Form_Library.jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

    jPanel3.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyPressed(java.awt.event.KeyEvent evt) {
            jPanel3KeyPressed(evt);
        }
    });

    tfName.setEditable(false);

    tfID.setEditable(false);

    tfIDCardNumber.setEditable(false);

    tfEmail.setEditable(false);

    tfAddress.setEditable(false);

    tfPhone.setEditable(false);

    cbSex.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Male", "Female" }));
    cbSex.setEnabled(false);
    cbSex.setMaximumSize(new java.awt.Dimension(450, 450));
    cbSex.setMinimumSize(new java.awt.Dimension(450, 450));
    cbSex.setName(""); // NOI18N

    carBirthday.setDateFormatString(bundle.getString("Form_Library.carBirthday.dateFormatString")); // NOI18N
    carBirthday.setEnabled(false);

    carActivationDate.setDateFormatString(bundle.getString("Form_Library.carActivationDate.dateFormatString")); // NOI18N
    carActivationDate.setEnabled(false);

    carExpiredDate.setDateFormatString(bundle.getString("Form_Library.carExpiredDate.dateFormatString")); // NOI18N
    carExpiredDate.setEnabled(false);

    jLabel6.setText(bundle.getString("Form_Library.jLabel6.text")); // NOI18N

    jLabel7.setText(bundle.getString("Form_Library.jLabel7.text")); // NOI18N

    jLabel8.setText(bundle.getString("Form_Library.jLabel8.text")); // NOI18N

    jLabel9.setText(bundle.getString("Form_Library.jLabel9.text")); // NOI18N

    jLabel10.setText(bundle.getString("Form_Library.jLabel10.text")); // NOI18N

    jLabel11.setText(bundle.getString("Form_Library.jLabel11.text")); // NOI18N

    jLabel12.setText(bundle.getString("Form_Library.jLabel12.text")); // NOI18N

    jLabel13.setText(bundle.getString("Form_Library.jLabel13.text")); // NOI18N

    jLabel14.setText(bundle.getString("Form_Library.jLabel14.text")); // NOI18N

    jLabel15.setText(bundle.getString("Form_Library.jLabel15.text")); // NOI18N

    tbReader.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null, null, null, null, null, null, null, null, null },
                    { null, null, null, null, null, null, null, null, null, null },
                    { null, null, null, null, null, null, null, null, null, null },
                    { null, null, null, null, null, null, null, null, null, null } },
            new String[] { "ID", "Name", "ID Card Number", "Sex", "Birthday", "Address", "Phone", "Email",
                    "Activation Date", "Expired Date" }) {
        Class[] types = new Class[] { java.lang.String.class, java.lang.String.class, java.lang.String.class,
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class,
                java.lang.String.class, java.lang.String.class, java.lang.String.class };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }
    });
    tbReader.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN);
    tbReader.setAutoCreateRowSorter(true);
    tbReader.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tbReaderMouseClicked(evt);
        }
    });
    jScrollPane2.setViewportView(tbReader);

    btnAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_add.png"))); // NOI18N
    btnAdd.setMnemonic('A');
    btnAdd.setText(bundle.getString("Form_Library.btnAdd.text")); // NOI18N
    btnAdd.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddActionPerformed(evt);
        }
    });

    btnEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    btnEdit.setMnemonic('U');
    btnEdit.setText(bundle.getString("Form_Library.btnEdit.text")); // NOI18N
    btnEdit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEditActionPerformed(evt);
        }
    });

    btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_delete.png"))); // NOI18N
    btnDelete.setMnemonic('D');
    btnDelete.setText(bundle.getString("Form_Library.btnDelete.text")); // NOI18N
    btnDelete.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnDeleteActionPerformed(evt);
        }
    });

    btnSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_search.png"))); // NOI18N
    btnSearch.setMnemonic('S');
    btnSearch.setText(bundle.getString("Form_Library.btnSearch.text")); // NOI18N
    btnSearch.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSearchActionPerformed(evt);
        }
    });

    btnSearch1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Redo-16.png"))); // NOI18N
    btnSearch1.setMnemonic('C');
    btnSearch1.setText(bundle.getString("Form_Library.btnSearch1.text")); // NOI18N
    btnSearch1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSearch1ActionPerformed(evt);
        }
    });

    taPrintReader.setColumns(20);
    taPrintReader.setRows(5);
    jScrollPane11.setViewportView(taPrintReader);

    btPrintReader.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Print-16.png"))); // NOI18N
    btPrintReader.setText(bundle.getString("Form_Library.btPrintReader.text")); // NOI18N
    btPrintReader.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btPrintReaderActionPerformed(evt);
        }
    });

    lbImageLink.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    btSaveReader.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Save-16.png"))); // NOI18N
    btSaveReader.setText(bundle.getString("Form_Library.btSaveReader.text")); // NOI18N
    btSaveReader.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btSaveReaderActionPerformed(evt);
        }
    });

    btBrowseReader.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Pictures Folder-20.png"))); // NOI18N
    btBrowseReader.setText(bundle.getString("Form_Library.btBrowseReader.text")); // NOI18N
    btBrowseReader.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btBrowseReaderActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout
            .setHorizontalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup().addGap(323, 323, 323)
                            .addComponent(btPrintReader, javax.swing.GroupLayout.PREFERRED_SIZE, 128,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(btnSearch1, javax.swing.GroupLayout.PREFERRED_SIZE, 128,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2)
                            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                    .addGroup(jPanel3Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                    .addGroup(jPanel3Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                                            .addGroup(jPanel3Layout
                                                                                    .createSequentialGroup()
                                                                                    .addGap(3, 3, 3)
                                                                                    .addComponent(jLabel6,
                                                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                            27,
                                                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                            .addGroup(jPanel3Layout
                                                                                    .createParallelGroup(
                                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                                            false)
                                                                                    .addComponent(
                                                                                            jLabel10,
                                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                            Short.MAX_VALUE)
                                                                                    .addComponent(jLabel7,
                                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                            Short.MAX_VALUE))
                                                                            .addComponent(jLabel8).addComponent(
                                                                                    jLabel9))
                                                                    .addGap(49, 49, 49)
                                                                    .addGroup(jPanel3Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                            false).addComponent(tfIDCardNumber)
                                                                            .addComponent(
                                                                                    tfName)
                                                                            .addComponent(carBirthday,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    Short.MAX_VALUE)
                                                                            .addComponent(tfID,
                                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                    225,
                                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                            .addComponent(cbSex,
                                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                    145,
                                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                    .addGap(19, 19, 19).addGroup(jPanel3Layout
                                                                            .createParallelGroup(
                                                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                                                    false)
                                                                            .addComponent(btnAdd,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    Short.MAX_VALUE)
                                                                            .addComponent(btnDelete,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    166, Short.MAX_VALUE))
                                                                    .addGap(18, 18, 18).addGroup(jPanel3Layout
                                                                            .createParallelGroup(
                                                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                                                    false)
                                                                            .addComponent(btSaveReader,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    Short.MAX_VALUE)
                                                                            .addComponent(
                                                                                    btnEdit,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    167, Short.MAX_VALUE))))
                                                    .addGap(0, 143, Short.MAX_VALUE)
                                                    .addGroup(jPanel3Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                                    false)
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                    .addComponent(jLabel15,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                            87,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                    .addGap(18, 18, 18).addComponent(
                                                                            carActivationDate,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            Short.MAX_VALUE))
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                    .addGroup(jPanel3Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                                            .addComponent(jLabel14,
                                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                    87,
                                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                            .addComponent(jLabel13)
                                                                            .addComponent(
                                                                                    jLabel12)
                                                                            .addComponent(jLabel11))
                                                                    .addGroup(jPanel3Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                                            .addGroup(jPanel3Layout
                                                                                    .createSequentialGroup()
                                                                                    .addGap(18, 18, 18)
                                                                                    .addComponent(
                                                                                            carExpiredDate,
                                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                            Short.MAX_VALUE))
                                                                            .addGroup(
                                                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                                                    jPanel3Layout
                                                                                            .createSequentialGroup()
                                                                                            .addPreferredGap(
                                                                                                    javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                                                                    18,
                                                                                                    Short.MAX_VALUE)
                                                                                            .addComponent(
                                                                                                    tfEmail,
                                                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                                    219,
                                                                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                            .addGroup(jPanel3Layout
                                                                                    .createSequentialGroup()
                                                                                    .addGap(18, 18, 18)
                                                                                    .addGroup(jPanel3Layout
                                                                                            .createParallelGroup(
                                                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                                                            .addComponent(
                                                                                                    tfPhone,
                                                                                                    javax.swing.GroupLayout.Alignment.TRAILING)
                                                                                            .addComponent(
                                                                                                    tfAddress)))))
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                    .addGroup(jPanel3Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.TRAILING,
                                                                            false)
                                                                            .addComponent(tfImageLink,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    175, Short.MAX_VALUE)
                                                                            .addComponent(tfSearch))
                                                                    .addPreferredGap(
                                                                            javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                    .addGroup(jPanel3Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                            false)
                                                                            .addComponent(btBrowseReader,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    139, Short.MAX_VALUE)
                                                                            .addComponent(btnSearch,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    Short.MAX_VALUE))))
                                                    .addGap(39, 39, 39)
                                                    .addComponent(lbImageLink,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 176,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(29, 29, 29))
                                            .addComponent(jScrollPane11))))
                            .addContainerGap()));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup().addGap(15, 15, 15)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(tfID, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel6).addComponent(jLabel11)
                                            .addComponent(tfAddress, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(tfName, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel12)
                                            .addComponent(tfPhone, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel7))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(tfEmail, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel13)
                                            .addComponent(tfIDCardNumber,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel8))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(carActivationDate,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(jPanel3Layout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel15).addComponent(jLabel9)
                                                    .addComponent(cbSex, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel14)
                                            .addComponent(carExpiredDate,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(carBirthday,
                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel10))
                                    .addGap(18, 18, 18)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(btnEdit).addComponent(btnAdd)
                                            .addComponent(tfSearch, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(btnSearch))
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel3Layout.createSequentialGroup().addGap(15, 15, 15)
                                                    .addGroup(jPanel3Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(tfImageLink,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(btBrowseReader,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 26,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                                            .addGroup(jPanel3Layout.createSequentialGroup().addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addGroup(jPanel3Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(btSaveReader)
                                                            .addComponent(btnDelete))))
                                    .addGap(37, 37, 37))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel3Layout.createSequentialGroup().addContainerGap()
                                            .addComponent(lbImageLink, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    248, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 119,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 151,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btPrintReader).addComponent(btnSearch1))
                    .addContainerGap(167, Short.MAX_VALUE)));

    jTabbedPane1.addTab(bundle.getString("Form_Library.jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

    tfBorrowID.setEditable(false);
    tfBorrowID.setText(bundle.getString("Form_Library.tfBorrowID.text")); // NOI18N

    carBorrowDate.setDateFormatString(bundle.getString("Form_Library.carBorrowDate.dateFormatString")); // NOI18N

    jLabel1.setText(bundle.getString("Form_Library.jLabel1.text")); // NOI18N

    carReturnDate.setDateFormatString(bundle.getString("Form_Library.carReturnDate.dateFormatString")); // NOI18N

    jLabel2.setText(bundle.getString("Form_Library.jLabel2.text")); // NOI18N

    jLabel3.setText(bundle.getString("Form_Library.jLabel3.text")); // NOI18N

    jLabel4.setText(bundle.getString("Form_Library.jLabel4.text")); // NOI18N

    jLabel5.setText(bundle.getString("Form_Library.jLabel5.text")); // NOI18N

    tbBorrowingManagement.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null, null, null, null }, { null, null, null, null, null },
                    { null, null, null, null, null }, { null, null, null, null, null } },
            new String[] { "Borrow ID", "Reader ID", "Book ID", "Borrow Date", "Return Date" }) {
        Class[] types = new Class[] { java.lang.Integer.class, java.lang.String.class, java.lang.String.class,
                java.lang.String.class, java.lang.String.class };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }
    });
    tbBorrowingManagement.setAutoCreateRowSorter(true);
    tbBorrowingManagement.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tbBorrowingManagementMouseClicked(evt);
        }
    });
    jScrollPane1.setViewportView(tbBorrowingManagement);

    btEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    btEdit.setMnemonic('U');
    btEdit.setText(bundle.getString("Form_Library.btEdit.text")); // NOI18N
    btEdit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btEditActionPerformed(evt);
        }
    });

    btDelete3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Redo-16.png"))); // NOI18N
    btDelete3.setMnemonic('C');
    btDelete3.setText(bundle.getString("Form_Library.btDelete3.text")); // NOI18N
    btDelete3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btDelete3ActionPerformed(evt);
        }
    });

    btDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_delete.png"))); // NOI18N
    btDelete.setMnemonic('D');
    btDelete.setText(bundle.getString("Form_Library.btDelete.text")); // NOI18N
    btDelete.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btDeleteActionPerformed(evt);
        }
    });

    btAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_add.png"))); // NOI18N
    btAdd.setMnemonic('A');
    btAdd.setText(bundle.getString("Form_Library.btAdd.text")); // NOI18N
    btAdd.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btAddActionPerformed(evt);
        }
    });

    jButton9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    Action buttonActionBor = new AbstractAction("",
            new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))) {

        @Override
        public void actionPerformed(ActionEvent evt) {
            BorrowingList.getList().clear();
            dmBorrowing.getDataVector().clear();
            BorrowingList.load("select * from borrowingmanagement");
            for (BorrowingManagement c : BorrowingList.getList()) {
                dmBorrowing.addRow(c.toVector());
            }
        }
    };

    String keyBor = "";

    jButton9.setAction(buttonActionBor);

    buttonActionBor.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_R);

    jButton9.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0),
            keyBor);

    jButton9.getActionMap().put(keyBor, buttonActionBor);
    jButton9.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton9ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
    jPanel18.setLayout(jPanel18Layout);
    jPanel18Layout
            .setHorizontalGroup(
                    jPanel18Layout
                            .createParallelGroup(
                                    javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel18Layout.createSequentialGroup().addGap(23, 23, 23)
                                            .addComponent(btAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 124,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(btEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(btDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18).addComponent(jButton9)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    423, Short.MAX_VALUE)
                                            .addComponent(btDelete3, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(28, 28, 28)));
    jPanel18Layout.setVerticalGroup(jPanel18Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel18Layout.createSequentialGroup()
                    .addContainerGap(38, Short.MAX_VALUE)
                    .addGroup(jPanel18Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton9, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel18Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(btDelete3).addComponent(btDelete).addComponent(btEdit)
                                            .addComponent(btAdd)))
                    .addContainerGap()));

    javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
    jPanel15.setLayout(jPanel15Layout);
    jPanel15Layout
            .setHorizontalGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createSequentialGroup().addGap(28, 28, 28)
                            .addGroup(jPanel15Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel15Layout.createSequentialGroup().addComponent(jLabel1)
                                            .addGap(18, 18, 18).addComponent(tfBorrowID))
                                    .addGroup(jPanel15Layout.createSequentialGroup().addComponent(jLabel5)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(carBorrowDate, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    212, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel15Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jPanel15Layout.createSequentialGroup().addComponent(jLabel4)
                                            .addGap(18, 18, 18).addComponent(
                                                    tfReaderID, javax.swing.GroupLayout.PREFERRED_SIZE, 210,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel15Layout.createSequentialGroup().addComponent(jLabel3)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(carReturnDate, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    208, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(78, 78, 78).addComponent(jLabel2).addGap(18, 18, 18)
                            .addComponent(tfBookBMID, javax.swing.GroupLayout.PREFERRED_SIZE, 263,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(19, 19, 19))
                    .addGroup(jPanel15Layout.createSequentialGroup().addContainerGap()
                            .addGroup(jPanel15Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane1).addComponent(jPanel18,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addContainerGap()));
    jPanel15Layout.setVerticalGroup(jPanel15Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup().addGap(20, 20, 20).addGroup(jPanel15Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1)
                    .addComponent(tfBorrowID, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(tfReaderID, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2).addComponent(tfBookBMID, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(carBorrowDate, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3).addComponent(carReturnDate,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE)));

    jTabbedPane3.addTab(bundle.getString("Form_Library.jPanel15.TabConstraints.tabTitle"), jPanel15); // NOI18N

    btSearchReturn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_search.png"))); // NOI18N
    btSearchReturn.setMnemonic('S');
    btSearchReturn.setText(bundle.getString("Form_Library.btSearchReturn.text")); // NOI18N
    btSearchReturn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btSearchReturnActionPerformed(evt);
        }
    });

    tbReturn.setModel(
            new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    tbReturn.setAutoCreateRowSorter(true);
    tbReturn.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tbReturnMouseClicked(evt);
        }
    });
    jScrollPane8.setViewportView(tbReturn);

    jLabel18.setText(bundle.getString("Form_Library.jLabel18.text")); // NOI18N

    jLabel19.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel19.setText(bundle.getString("Form_Library.jLabel19.text")); // NOI18N

    jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    Action buttonAction = new AbstractAction("",
            new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))) {

        @Override
        public void actionPerformed(ActionEvent evt) {
            ReturnList.getReturnList().clear();
            dmReturn.getDataVector().clear();
            ReturnList.load(
                    "select borrowingmanagement.BorrowID, borrowingmanagement.BookID, reader.RdName, book.BookName, author.AuthorName, publisher.PublisherName, book.Price, borrowingmanagement.BorrowDate, borrowingmanagement.ReturnDate\n"
                            + "from borrowingmanagement\n"
                            + "inner join book on borrowingmanagement.BookID = book.BookID\n"
                            + "inner join author on book.AuthorID = author.AuthorID\n"
                            + "inner join publisher on book.PublisherID = publisher.PublisherID\n"
                            + "inner join reader on borrowingmanagement.RdID = reader.RdID");
            for (ReturnManagement c : ReturnList.getReturnList()) {
                dmReturn.addRow(c.toVector());
            }
        }
    };

    String key = "";

    jButton8.setAction(buttonAction);

    buttonAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_R);

    jButton8.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), key);

    jButton8.getActionMap().put(key, buttonAction);
    jButton8.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton8ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
    jPanel16.setLayout(jPanel16Layout);
    jPanel16Layout.setHorizontalGroup(jPanel16Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup().addGroup(jPanel16Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel16Layout.createSequentialGroup().addGroup(jPanel16Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel16Layout.createSequentialGroup().addGap(259, 259, 259)
                                    .addComponent(jLabel18)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(tfSearchReturn, javax.swing.GroupLayout.PREFERRED_SIZE, 200,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(btSearchReturn, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18).addComponent(jButton8))
                            .addGroup(jPanel16Layout.createSequentialGroup().addGap(271, 271, 271)
                                    .addComponent(jLabel19)))
                            .addGap(0, 391, Short.MAX_VALUE))
                    .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap()
                            .addComponent(jScrollPane8)))
                    .addContainerGap()));
    jPanel16Layout.setVerticalGroup(jPanel16Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 37,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel16Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel16Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(tfSearchReturn, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btSearchReturn).addComponent(jLabel18))
                            .addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(8, 8, 8)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 635, Short.MAX_VALUE)
                    .addContainerGap()));

    jTabbedPane3.addTab(bundle.getString("Form_Library.jPanel16.TabConstraints.tabTitle"), jPanel16); // NOI18N

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane3));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane3));

    jTabbedPane1.addTab(bundle.getString("Form_Library.jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

    lbSupplierID1.setText(bundle.getString("Form_Library.lbSupplierID1.text")); // NOI18N

    lbSupplierName.setText(bundle.getString("Form_Library.lbSupplierName.text")); // NOI18N

    tfSupplierID1.setEditable(false);

    lbPhone.setText(bundle.getString("Form_Library.lbPhone.text")); // NOI18N

    lbAddress.setText(bundle.getString("Form_Library.lbAddress.text")); // NOI18N

    javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
    jPanel14.setLayout(jPanel14Layout);
    jPanel14Layout.setHorizontalGroup(jPanel14Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup().addGap(49, 49, 49)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbPhone).addComponent(lbSupplierID1,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 71,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ftfPhoneSupplier, javax.swing.GroupLayout.DEFAULT_SIZE, 272,
                                    Short.MAX_VALUE)
                            .addComponent(tfSupplierID1))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 272, Short.MAX_VALUE)
                    .addGroup(
                            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(lbSupplierName, javax.swing.GroupLayout.DEFAULT_SIZE, 95,
                                            Short.MAX_VALUE)
                                    .addComponent(lbAddress, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(tfSupplierName, javax.swing.GroupLayout.DEFAULT_SIZE, 273,
                                            Short.MAX_VALUE)
                                    .addComponent(tfAddressSuplier))
                    .addGap(49, 49, 49)));
    jPanel14Layout.setVerticalGroup(jPanel14Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup().addGap(21, 21, 21).addGroup(jPanel14Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tfSupplierName, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbSupplierID1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tfSupplierID1).addComponent(lbSupplierName,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbAddress, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel14Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(lbPhone).addComponent(ftfPhoneSupplier)
                                    .addComponent(tfAddressSuplier)))
                    .addContainerGap()));

    tbSupplierAdmin
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    tbSupplierAdmin.setColumnSelectionAllowed(true);
    tbSupplierAdmin.setName(""); // NOI18N
    tbSupplierAdmin.setAutoCreateRowSorter(true);
    tbSupplierAdmin.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tbSupplierAdminMouseClicked(evt);
        }
    });
    jScrollPane7.setViewportView(tbSupplierAdmin);

    btEditSupplier.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/gtk-refresh.png"))); // NOI18N
    btEditSupplier.setMnemonic('U');
    btEditSupplier.setText(bundle.getString("Form_Library.btEditSupplier.text")); // NOI18N
    btEditSupplier.setMaximumSize(new java.awt.Dimension(63, 23));
    btEditSupplier.setMinimumSize(new java.awt.Dimension(63, 23));
    btEditSupplier.setPreferredSize(new java.awt.Dimension(63, 23));
    btEditSupplier.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btEditSupplierActionPerformed(evt);
        }
    });

    btDeleteSupplier.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_delete.png"))); // NOI18N
    btDeleteSupplier.setMnemonic('D');
    btDeleteSupplier.setText(bundle.getString("Form_Library.btDeleteSupplier.text")); // NOI18N
    btDeleteSupplier.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btDeleteSupplierActionPerformed(evt);
        }
    });

    btClose3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Redo-16.png"))); // NOI18N
    btClose3.setText(bundle.getString("Form_Library.btClose3.text")); // NOI18N
    btClose3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btClose3ActionPerformed(evt);
        }
    });

    btAddSupplier.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/btn_add.png"))); // NOI18N
    btAddSupplier.setMnemonic('A');
    btAddSupplier.setText(bundle.getString("Form_Library.btAddSupplier.text")); // NOI18N
    btAddSupplier.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btAddSupplierActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
    jPanel17.setLayout(jPanel17Layout);
    jPanel17Layout.setHorizontalGroup(jPanel17Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)
            .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel17Layout.createSequentialGroup().addContainerGap()
                            .addComponent(btAddSupplier, javax.swing.GroupLayout.DEFAULT_SIZE, 199,
                                    Short.MAX_VALUE)
                            .addGap(18, 18, 18)
                            .addComponent(btEditSupplier, javax.swing.GroupLayout.DEFAULT_SIZE, 210,
                                    Short.MAX_VALUE)
                            .addGap(18, 18, 18)
                            .addComponent(btDeleteSupplier, javax.swing.GroupLayout.DEFAULT_SIZE, 210,
                                    Short.MAX_VALUE)
                            .addGap(18, 18, 18)
                            .addComponent(btClose3, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
                            .addContainerGap())));
    jPanel17Layout.setVerticalGroup(jPanel17Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)
            .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel17Layout.createSequentialGroup().addGap(38, 38, 38)
                            .addGroup(jPanel17Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(btAddSupplier, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btDeleteSupplier, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btEditSupplier, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btClose3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGap(39, 39, 39))));

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout
            .setHorizontalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                            .addContainerGap().addComponent(jScrollPane7).addContainerGap()));
    jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup().addGap(19, 19, 19)
                    .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, 63,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE)
                    .addGap(176, 176, 176)));

    jTabbedPane1.addTab(bundle.getString("Form_Library.jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

    jLabel21.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
    jLabel21.setText(bundle.getString("Form_Library.jLabel21.text")); // NOI18N

    jLabel22.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel22.setText(bundle.getString("Form_Library.jLabel22.text")); // NOI18N

    tbPhieuQuaHan
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }) {
                boolean[] canEdit = new boolean[] { false, false, false, false };

                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return false;
                }
            });
    tbPhieuQuaHan.setAutoCreateRowSorter(true);
    jScrollPane9.setViewportView(tbPhieuQuaHan);

    btPrintStas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Print-16.png"))); // NOI18N
    btPrintStas.setText(bundle.getString("Form_Library.btPrintStas.text")); // NOI18N
    btPrintStas.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btPrintStasActionPerformed(evt);
        }
    });

    taBaoCao.setColumns(20);
    taBaoCao.setFont(new java.awt.Font("Monospaced", 1, 14)); // NOI18N
    taBaoCao.setRows(5);
    taBaoCao.setText(bundle.getString("Form_Library.taBaoCao.text")); // NOI18N
    jScrollPane10.setViewportView(taBaoCao);

    jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Bar Chart-16.png"))); // NOI18N
    jButton6.setText(bundle.getString("Form_Library.jButton6.text")); // NOI18N
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
        }
    });

    jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Gmail-16.png"))); // NOI18N
    jButton7.setText(bundle.getString("Form_Library.jButton7.text")); // NOI18N
    jButton7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton7ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane10, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane9, javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel6Layout.createSequentialGroup().addGroup(jPanel6Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jPanel6Layout.createSequentialGroup().addGap(945, 945, 945)
                                            .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 135,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel6Layout.createSequentialGroup().addGroup(jPanel6Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel6Layout.createSequentialGroup()
                                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE)
                                                    .addComponent(jLabel21).addGap(284, 284, 284))
                                            .addGroup(jPanel6Layout.createSequentialGroup().addGap(62, 62, 62)
                                                    .addGroup(jPanel6Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addComponent(lbTongPhieuQuaHan,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    Short.MAX_VALUE)
                                                            .addComponent(lbTongSach,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    Short.MAX_VALUE)
                                                            .addGroup(jPanel6Layout.createSequentialGroup()
                                                                    .addGroup(jPanel6Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                                            .addComponent(lbTongKhach,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    Short.MAX_VALUE)
                                                                            .addComponent(lbTongPhieu,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    Short.MAX_VALUE)
                                                                            .addComponent(lbTongKhachMuon,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                    Short.MAX_VALUE))
                                                                    .addPreferredGap(
                                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                    .addComponent(jLabel23)))
                                                    .addGap(107, 107, 107)))
                                            .addGap(85, 85, 85)
                                            .addGroup(jPanel6Layout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jButton7,
                                                            javax.swing.GroupLayout.Alignment.TRAILING,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 135,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(btPrintStas,
                                                            javax.swing.GroupLayout.Alignment.TRAILING,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 135,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addGap(11, 11, 11)))
                    .addContainerGap())
            .addGroup(jPanel6Layout.createSequentialGroup().addGap(395, 395, 395).addComponent(jLabel22)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addComponent(jLabel21)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                    .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 0,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(lbTongKhach)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(lbTongSach)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel6Layout.createSequentialGroup().addComponent(lbTongPhieu)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(lbTongKhachMuon))
                            .addComponent(btPrintStas, javax.swing.GroupLayout.Alignment.TRAILING))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel6Layout.createSequentialGroup().addComponent(lbTongPhieuQuaHan)
                                    .addGap(25, 25, 25).addComponent(jLabel22))
                            .addGroup(jPanel6Layout.createSequentialGroup().addComponent(jButton7)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton6)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 218,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)));

    jTabbedPane1.addTab(bundle.getString("Form_Library.jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING));

    pack();
}