List of usage examples for java.awt.event KeyEvent VK_R
int VK_R
To view the source code for java.awt.event KeyEvent VK_R.
Click Source Link
From source file:tvbrowser.ui.mainframe.MainFrame.java
/** * Adds the keyboard actions for going to the program table with the keyboard. * */// www .j ava 2 s. co m public void addKeyboardAction() { mProgramTableScrollPane.deSelectItem(); // register the global hot keys, so they also work when the main menu is not visible for (final TVBrowserAction action : TVBrowserActions.getActions()) { KeyStroke keyStroke = action.getAccelerator(); if (keyStroke != null) { rootPane.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { if (action.isEnabled()) { action.actionPerformed(null); } } }, keyStroke, JComponent.WHEN_IN_FOCUSED_WINDOW); } } KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_UP), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_UP), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_RIGHT), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_RIGHT), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_DOWN), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_DOWN), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_LEFT), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_LEFT), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_CONTEXT_MENU, 0, true); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_CONTEXTMENU), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_R, 0, true); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_CONTEXTMENU), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_DESELECT), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_L, 0, true); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_SINGLECLICK), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_D, 0, true); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_DOUBLECLICK), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_M, 0, true); rootPane.registerKeyboardAction(new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_MIDDLECLICK), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_O, 0, true); rootPane.registerKeyboardAction( new KeyboardAction(mProgramTableScrollPane, KeyboardAction.KEY_MIDDLE_DOUBLE_CLICK), stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(TVBrowserActions.goToNextDay, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_MASK); rootPane.registerKeyboardAction(TVBrowserActions.goToPreviousDay, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); // return from full screen using ESCAPE stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); rootPane.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { if (isFullScreenMode()) { TVBrowserActions.fullScreen.actionPerformed(null); } else { mProgramTableScrollPane.getProgramTable().stopAutoScroll(); mAutoDownloadTimer = -1; mLastTimerMinutesAfterMidnight = IOUtilities.getMinutesAfterMidnight(); TVBrowser.stopAutomaticDownload(); if (TVBrowserActions.update.isUpdating()) { TVBrowserActions.update.actionPerformed(null); } } } }, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0); rootPane.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { goToLeftSide(); } }, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_END, 0); rootPane.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { goToRightSide(); } }, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK); rootPane.registerKeyboardAction(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { mProgramTableScrollPane.scrollPageRight(); } }, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); stroke = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK); rootPane.registerKeyboardAction(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { mProgramTableScrollPane.scrollPageLeft(); } }, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); this.setRootPane(rootPane); }
From source file:savant.view.swing.Savant.java
/** * 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./*from ww w. j a v a 2s . c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { view_buttongroup = new javax.swing.ButtonGroup(); toolbar_bottom = new javax.swing.JToolBar(); label_mouseposition_title = new javax.swing.JLabel(); mousePositionLabel = new javax.swing.JLabel(); timeCaption = new javax.swing.JLabel(); label_status = new javax.swing.JLabel(); s_e_sep = new javax.swing.JToolBar.Separator(); label_memory = new javax.swing.JLabel(); panel_browser = new javax.swing.JPanel(); panel_top = new javax.swing.JPanel(); panelExtendedMiddle = new javax.swing.JPanel(); panel_main = new javax.swing.JPanel(); pluginToolbar = new javax.swing.JPanel(); menuBar_top = new javax.swing.JMenuBar(); fileMenu = new javax.swing.JMenu(); loadGenomeItem = new javax.swing.JMenuItem(); loadFromFileItem = new javax.swing.JMenuItem(); loadFromURLItem = new javax.swing.JMenuItem(); loadFromDataSourcePluginItem = new javax.swing.JMenuItem(); recentTrackMenu = new javax.swing.JMenu(); javax.swing.JPopupMenu.Separator jSeparator1 = new javax.swing.JPopupMenu.Separator(); openProjectItem = new javax.swing.JMenuItem(); recentProjectMenu = new javax.swing.JMenu(); saveProjectItem = new javax.swing.JMenuItem(); saveProjectAsItem = new javax.swing.JMenuItem(); javax.swing.JPopupMenu.Separator jSeparator2 = new javax.swing.JPopupMenu.Separator(); formatItem = new javax.swing.JMenuItem(); javax.swing.JPopupMenu.Separator jSeparator3 = new javax.swing.JPopupMenu.Separator(); exportItem = new javax.swing.JMenuItem(); jSeparator4 = new javax.swing.JPopupMenu.Separator(); exitItem = new javax.swing.JMenuItem(); editMenu = new javax.swing.JMenu(); undoItem = new javax.swing.JMenuItem(); redoItem = new javax.swing.JMenuItem(); javax.swing.JPopupMenu.Separator jSeparator6 = new javax.swing.JPopupMenu.Separator(); bookmarkItem = new javax.swing.JMenuItem(); deselectAllItem = new javax.swing.JMenuItem(); jSeparator7 = new javax.swing.JPopupMenu.Separator(); preferencesItem = new javax.swing.JMenuItem(); viewMenu = new javax.swing.JMenu(); panLeftItem = new javax.swing.JMenuItem(); panRightItem = new javax.swing.JMenuItem(); zoomInItem = new javax.swing.JMenuItem(); zoomOutItem = new javax.swing.JMenuItem(); toStartItem = new javax.swing.JMenuItem(); toEndItem = new javax.swing.JMenuItem(); javax.swing.JSeparator jSeparator8 = new javax.swing.JSeparator(); crosshairItem = new javax.swing.JCheckBoxMenuItem(); plumblineItem = new javax.swing.JCheckBoxMenuItem(); spotlightItem = new javax.swing.JCheckBoxMenuItem(); windowMenu = new javax.swing.JMenu(); navigationItem = new javax.swing.JCheckBoxMenuItem(); genomeItem = new javax.swing.JCheckBoxMenuItem(); rulerItem = new javax.swing.JCheckBoxMenuItem(); pluginToolbarItem = new javax.swing.JCheckBoxMenuItem(); statusBarItem = new javax.swing.JCheckBoxMenuItem(); speedAndEfficiencyItem = new javax.swing.JCheckBoxMenuItem(); javax.swing.JSeparator jSeparator9 = new javax.swing.JSeparator(); bookmarksItem = new javax.swing.JCheckBoxMenuItem(); pluginsMenu = new javax.swing.JMenu(); menuitem_pluginmanager = new javax.swing.JMenuItem(); jSeparator10 = new javax.swing.JPopupMenu.Separator(); helpMenu = new javax.swing.JMenu(); userManualItem = new javax.swing.JMenuItem(); tutorialsItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem checkForUpdatesItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem bugReportItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem featureRequestItem = new javax.swing.JMenuItem(); javax.swing.JSeparator jSeparator11 = new javax.swing.JSeparator(); websiteItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setBackground(new java.awt.Color(204, 204, 204)); toolbar_bottom.setFloatable(false); toolbar_bottom.setAlignmentX(1.0F); label_mouseposition_title.setText(" Position: "); toolbar_bottom.add(label_mouseposition_title); toolbar_bottom.add(mousePositionLabel); timeCaption.setText("Time: "); toolbar_bottom.add(timeCaption); label_status.setMaximumSize(new java.awt.Dimension(300, 14)); label_status.setMinimumSize(new java.awt.Dimension(100, 14)); label_status.setPreferredSize(new java.awt.Dimension(100, 14)); toolbar_bottom.add(label_status); toolbar_bottom.add(s_e_sep); label_memory.setText(" Memory: "); toolbar_bottom.add(label_memory); panel_top.setMaximumSize(new java.awt.Dimension(1000, 30)); panel_top.setMinimumSize(new java.awt.Dimension(0, 0)); panel_top.setPreferredSize(new java.awt.Dimension(0, 30)); panel_top.setLayout(new java.awt.BorderLayout()); panelExtendedMiddle.setMinimumSize(new java.awt.Dimension(990, 30)); panelExtendedMiddle.setPreferredSize(new java.awt.Dimension(990, 30)); javax.swing.GroupLayout panelExtendedMiddleLayout = new javax.swing.GroupLayout(panelExtendedMiddle); panelExtendedMiddle.setLayout(panelExtendedMiddleLayout); panelExtendedMiddleLayout.setHorizontalGroup(panelExtendedMiddleLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1045, Short.MAX_VALUE)); panelExtendedMiddleLayout.setVerticalGroup(panelExtendedMiddleLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 30, Short.MAX_VALUE)); panel_top.add(panelExtendedMiddle, java.awt.BorderLayout.CENTER); panel_main.setBackground(new java.awt.Color(153, 153, 153)); panel_main.setMaximumSize(new java.awt.Dimension(99999, 99999)); panel_main.setMinimumSize(new java.awt.Dimension(1, 1)); panel_main.setPreferredSize(new java.awt.Dimension(99999, 99999)); javax.swing.GroupLayout panel_mainLayout = new javax.swing.GroupLayout(panel_main); panel_main.setLayout(panel_mainLayout); panel_mainLayout.setHorizontalGroup(panel_mainLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); panel_mainLayout.setVerticalGroup(panel_mainLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 532, Short.MAX_VALUE)); pluginToolbar.setVisible(false); pluginToolbar.setPreferredSize(new java.awt.Dimension(856, 24)); pluginToolbar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEADING)); javax.swing.GroupLayout panel_browserLayout = new javax.swing.GroupLayout(panel_browser); panel_browser.setLayout(panel_browserLayout); panel_browserLayout.setHorizontalGroup( panel_browserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panel_top, javax.swing.GroupLayout.DEFAULT_SIZE, 1045, Short.MAX_VALUE) .addComponent(pluginToolbar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_main, javax.swing.GroupLayout.DEFAULT_SIZE, 1045, Short.MAX_VALUE)); panel_browserLayout.setVerticalGroup(panel_browserLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_browserLayout.createSequentialGroup().addContainerGap() .addComponent(panel_top, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(pluginToolbar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(panel_main, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE))); fileMenu.setText("File"); loadGenomeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK)); loadGenomeItem.setText("Load Genome..."); loadGenomeItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadGenomeItemActionPerformed(evt); } }); fileMenu.add(loadGenomeItem); loadFromFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK)); loadFromFileItem.setText("Load Track from File..."); loadFromFileItem.setEnabled(false); loadFromFileItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadFromFileItemActionPerformed(evt); } }); fileMenu.add(loadFromFileItem); loadFromURLItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK)); loadFromURLItem.setText("Load Track from URL..."); loadFromURLItem.setEnabled(false); loadFromURLItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadFromURLItemActionPerformed(evt); } }); fileMenu.add(loadFromURLItem); loadFromDataSourcePluginItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK)); loadFromDataSourcePluginItem.setText("Load Track from Repository..."); loadFromDataSourcePluginItem.setEnabled(false); loadFromDataSourcePluginItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadFromDataSourcePluginItemActionPerformed(evt); } }); fileMenu.add(loadFromDataSourcePluginItem); recentTrackMenu.setText("Load Recent Track"); fileMenu.add(recentTrackMenu); fileMenu.add(jSeparator1); openProjectItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK)); openProjectItem.setText("Open Project..."); openProjectItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openProjectItemActionPerformed(evt); } }); fileMenu.add(openProjectItem); recentProjectMenu.setText("Open Recent Project"); fileMenu.add(recentProjectMenu); saveProjectItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); saveProjectItem.setText("Save Project"); saveProjectItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveProjectItemActionPerformed(evt); } }); fileMenu.add(saveProjectItem); saveProjectAsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); saveProjectAsItem.setText("Save Project As..."); saveProjectAsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveProjectAsItemActionPerformed(evt); } }); fileMenu.add(saveProjectAsItem); fileMenu.add(jSeparator2); formatItem.setText("Format File..."); formatItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { formatItemActionPerformed(evt); } }); fileMenu.add(formatItem); fileMenu.add(jSeparator3); exportItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK)); exportItem.setText("Export Track Images..."); exportItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuitem_exportActionPerformed(evt); } }); fileMenu.add(exportItem); fileMenu.add(jSeparator4); exitItem.setText("Exit"); exitItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitItemActionPerformed(evt); } }); fileMenu.add(exitItem); menuBar_top.add(fileMenu); editMenu.setText("Edit"); undoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_MASK)); undoItem.setText("Undo Range Change"); undoItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { undoItemActionPerformed(evt); } }); editMenu.add(undoItem); redoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.CTRL_MASK)); redoItem.setText("Redo Range Change"); redoItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { redoItemActionPerformed(evt); } }); editMenu.add(redoItem); editMenu.add(jSeparator6); bookmarkItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK)); bookmarkItem.setText("Bookmark"); bookmarkItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bookmarkItemActionPerformed(evt); } }); editMenu.add(bookmarkItem); deselectAllItem.setText("Deselect All"); deselectAllItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuitem_deselectActionPerformed(evt); } }); editMenu.add(deselectAllItem); editMenu.add(jSeparator7); preferencesItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK)); preferencesItem.setText("Preferences"); preferencesItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { preferencesItemActionPerformed(evt); } }); editMenu.add(preferencesItem); menuBar_top.add(editMenu); viewMenu.setText("View"); panLeftItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_LEFT, java.awt.event.InputEvent.SHIFT_MASK)); panLeftItem.setText("Pan Left"); panLeftItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panLeftItemActionPerformed(evt); } }); viewMenu.add(panLeftItem); panRightItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_RIGHT, java.awt.event.InputEvent.SHIFT_MASK)); panRightItem.setText("Pan Right"); panRightItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panRightItemActionPerformed(evt); } }); viewMenu.add(panRightItem); zoomInItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_UP, java.awt.event.InputEvent.SHIFT_MASK)); zoomInItem.setText("Zoom In"); zoomInItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { zoomInItemActionPerformed(evt); } }); viewMenu.add(zoomInItem); zoomOutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DOWN, java.awt.event.InputEvent.SHIFT_MASK)); zoomOutItem.setText("Zoom Out"); zoomOutItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { zoomOutItemActionPerformed(evt); } }); viewMenu.add(zoomOutItem); toStartItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_HOME, 0)); toStartItem.setText("Shift to Start"); toStartItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toStartItemActionPerformed(evt); } }); viewMenu.add(toStartItem); toEndItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_END, 0)); toEndItem.setText("Shift to End"); toEndItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toEndItemActionPerformed(evt); } }); viewMenu.add(toEndItem); viewMenu.add(jSeparator8); crosshairItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_J, java.awt.event.InputEvent.CTRL_MASK)); crosshairItem.setText("Crosshair"); crosshairItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { crosshairItemActionPerformed(evt); } }); viewMenu.add(crosshairItem); plumblineItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, java.awt.event.InputEvent.CTRL_MASK)); plumblineItem.setText("Plumbline"); plumblineItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { plumblineItemActionPerformed(evt); } }); viewMenu.add(plumblineItem); spotlightItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK)); spotlightItem.setText("Spotlight"); spotlightItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { spotlightItemActionPerformed(evt); } }); viewMenu.add(spotlightItem); menuBar_top.add(viewMenu); windowMenu.setText("Window"); windowMenu.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { windowMenuStateChanged(evt); } }); navigationItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); navigationItem.setText("Navigation"); navigationItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { navigationItemMousePressed(evt); } }); windowMenu.add(navigationItem); genomeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); genomeItem.setText("Genome"); genomeItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { genomeItemActionPerformed(evt); } }); windowMenu.add(genomeItem); rulerItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); rulerItem.setText("Ruler"); rulerItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rulerItemActionPerformed(evt); } }); windowMenu.add(rulerItem); pluginToolbarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); pluginToolbarItem.setSelected(true); pluginToolbarItem.setText("Plugin Toolbar"); pluginToolbarItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pluginToolbarItemActionPerformed(evt); } }); windowMenu.add(pluginToolbarItem); statusBarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); statusBarItem.setSelected(true); statusBarItem.setText("Status Bar"); statusBarItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { statusBarItemActionPerformed(evt); } }); windowMenu.add(statusBarItem); speedAndEfficiencyItem.setText("Resources"); speedAndEfficiencyItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { speedAndEfficiencyItemActionPerformed(evt); } }); windowMenu.add(speedAndEfficiencyItem); windowMenu.add(jSeparator9); bookmarksItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); bookmarksItem.setText("Bookmarks"); bookmarksItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bookmarksItemActionPerformed(evt); } }); windowMenu.add(bookmarksItem); menuBar_top.add(windowMenu); pluginsMenu.setText("Plugins"); menuitem_pluginmanager.setText("Plugin Manager"); menuitem_pluginmanager.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuitem_pluginmanagerActionPerformed(evt); } }); pluginsMenu.add(menuitem_pluginmanager); pluginsMenu.add(jSeparator10); menuBar_top.add(pluginsMenu); helpMenu.setText("Help"); userManualItem.setText("Manuals"); userManualItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userManualItemActionPerformed(evt); } }); helpMenu.add(userManualItem); tutorialsItem.setText("Video Tutorials"); tutorialsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tutorialsItemActionPerformed(evt); } }); helpMenu.add(tutorialsItem); checkForUpdatesItem.setText("Check for updates"); checkForUpdatesItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkForUpdatesItemActionPerformed(evt); } }); helpMenu.add(checkForUpdatesItem); bugReportItem.setText("Report an issue"); bugReportItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bugReportItemActionPerformed(evt); } }); helpMenu.add(bugReportItem); featureRequestItem.setText("Request a feature"); featureRequestItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { featureRequestItemActionPerformed(evt); } }); helpMenu.add(featureRequestItem); helpMenu.add(jSeparator11); websiteItem.setText("Website"); websiteItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { websiteItemActionPerformed(evt); } }); helpMenu.add(websiteItem); menuBar_top.add(helpMenu); setJMenuBar(menuBar_top); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panel_browser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(toolbar_bottom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(panel_browser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(toolbar_bottom, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))); pack(); }
From source file:pl.otros.logview.gui.LogViewMainFrame.java
private void initToolbar() { toolBar = new JToolBar(); final JComboBox searchMode = new JComboBox( new String[] { "String contains search: ", "Regex search: ", "Query search: " }); final SearchAction searchActionForward = new SearchAction(otrosApplication, SearchDirection.FORWARD); final SearchAction searchActionBackward = new SearchAction(otrosApplication, SearchDirection.REVERSE); searchFieldCbxModel = new DefaultComboBoxModel(); searchField = new JXComboBox(searchFieldCbxModel); searchField.setEditable(true);// w w w . j a v a 2 s . c om AutoCompleteDecorator.decorate(searchField); searchField.setMinimumSize(new Dimension(150, 10)); searchField.setPreferredSize(new Dimension(250, 10)); searchField.setToolTipText( "<HTML>Enter text to search.<BR/>" + "Enter - search next,<BR/>Alt+Enter search previous,<BR/>" + "Ctrl+Enter - mark all found</HTML>"); final DelayedSwingInvoke delayedSearchResultUpdate = new DelayedSwingInvoke() { @Override protected void performActionHook() { JTextComponent editorComponent = (JTextComponent) searchField.getEditor().getEditorComponent(); int stringEnd = editorComponent.getSelectionStart(); if (stringEnd < 0) { stringEnd = editorComponent.getText().length(); } try { String selectedText = editorComponent.getText(0, stringEnd); if (StringUtils.isBlank(selectedText)) { return; } OtrosJTextWithRulerScrollPane<JTextPane> logDetailWithRulerScrollPane = otrosApplication .getSelectedLogViewPanel().getLogDetailWithRulerScrollPane(); MessageUpdateUtils.highlightSearchResult(logDetailWithRulerScrollPane, otrosApplication.getAllPluginables().getMessageColorizers()); RulerBarHelper.scrollToFirstMarker(logDetailWithRulerScrollPane); } catch (BadLocationException e) { LOGGER.log(Level.SEVERE, "Can't update search highlight", e); } } }; JTextComponent searchFieldTextComponent = (JTextComponent) searchField.getEditor().getEditorComponent(); searchFieldTextComponent.getDocument().addDocumentListener(new DocumentInsertUpdateHandler() { @Override protected void documentChanged(DocumentEvent e) { delayedSearchResultUpdate.performAction(); } }); final MarkAllFoundAction markAllFoundAction = new MarkAllFoundAction(otrosApplication); final SearchModeValidatorDocumentListener searchValidatorDocumentListener = new SearchModeValidatorDocumentListener( (JTextField) searchField.getEditor().getEditorComponent(), observer, SearchMode.STRING_CONTAINS); SearchMode searchModeFromConfig = configuration.get(SearchMode.class, "gui.searchMode", SearchMode.STRING_CONTAINS); final String lastSearchString; int selectedSearchMode = 0; if (searchModeFromConfig.equals(SearchMode.STRING_CONTAINS)) { selectedSearchMode = 0; lastSearchString = configuration.getString(ConfKeys.SEARCH_LAST_STRING, ""); } else if (searchModeFromConfig.equals(SearchMode.REGEX)) { selectedSearchMode = 1; lastSearchString = configuration.getString(ConfKeys.SEARCH_LAST_REGEX, ""); } else if (searchModeFromConfig.equals(SearchMode.QUERY)) { selectedSearchMode = 2; lastSearchString = configuration.getString(ConfKeys.SEARCH_LAST_QUERY, ""); } else { LOGGER.warning("Unknown search mode " + searchModeFromConfig); lastSearchString = ""; } Component editorComponent = searchField.getEditor().getEditorComponent(); if (editorComponent instanceof JTextField) { final JTextField sfTf = (JTextField) editorComponent; sfTf.getDocument().addDocumentListener(searchValidatorDocumentListener); sfTf.getDocument().addDocumentListener(new DocumentInsertUpdateHandler() { @Override protected void documentChanged(DocumentEvent e) { try { int length = e.getDocument().getLength(); if (length > 0) { searchResultColorizer.setSearchString(e.getDocument().getText(0, length)); } } catch (BadLocationException e1) { LOGGER.log(Level.SEVERE, "Error: ", e1); } } }); sfTf.addKeyListener(new SearchFieldKeyListener(searchActionForward, sfTf)); sfTf.setText(lastSearchString); } searchMode.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { SearchMode mode = null; boolean validationEnabled = false; String confKey = null; String lastSearch = ((JTextField) searchField.getEditor().getEditorComponent()).getText(); if (searchMode.getSelectedIndex() == 0) { mode = SearchMode.STRING_CONTAINS; searchValidatorDocumentListener.setSearchMode(mode); validationEnabled = false; searchMode.setToolTipText("Checking if log message contains string (case is ignored)"); confKey = ConfKeys.SEARCH_LAST_STRING; } else if (searchMode.getSelectedIndex() == 1) { mode = SearchMode.REGEX; validationEnabled = true; searchMode .setToolTipText("Checking if log message matches regular expression (case is ignored)"); confKey = ConfKeys.SEARCH_LAST_REGEX; } else if (searchMode.getSelectedIndex() == 2) { mode = SearchMode.QUERY; validationEnabled = true; String querySearchTooltip = "<HTML>" + // "Advance search using SQL-like quries (i.e. level>=warning && msg~=failed && thread==t1)<BR/>" + // "Valid operator for query search is ==, ~=, !=, LIKE, EXISTS, <, <=, >, >=, &&, ||, ! <BR/>" + // "See wiki for more info<BR/>" + // "</HTML>"; searchMode.setToolTipText(querySearchTooltip); confKey = ConfKeys.SEARCH_LAST_QUERY; } searchValidatorDocumentListener.setSearchMode(mode); searchValidatorDocumentListener.setEnable(validationEnabled); searchActionForward.setSearchMode(mode); searchActionBackward.setSearchMode(mode); markAllFoundAction.setSearchMode(mode); configuration.setProperty("gui.searchMode", mode); searchResultColorizer.setSearchMode(mode); List<Object> list = configuration.getList(confKey); searchFieldCbxModel.removeAllElements(); for (Object o : list) { searchFieldCbxModel.addElement(o); } searchField.setSelectedItem(lastSearch); } }); searchMode.setSelectedIndex(selectedSearchMode); final JCheckBox markFound = new JCheckBox("Mark search result"); markFound.setMnemonic(KeyEvent.VK_M); searchField.addKeyListener(markAllFoundAction); configuration.addConfigurationListener(markAllFoundAction); JButton markAllFoundButton = new JButton(markAllFoundAction); final JComboBox markColor = new JComboBox(MarkerColors.values()); markFound.setSelected(configuration.getBoolean("gui.markFound", true)); markFound.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { boolean selected = markFound.isSelected(); searchActionForward.setMarkFound(selected); searchActionBackward.setMarkFound(selected); configuration.setProperty("gui.markFound", markFound.isSelected()); } }); markColor.setRenderer(new MarkerColorsComboBoxRenderer()); // markColor.addActionListener(new ActionListener() { // // @Override // public void actionPerformed(ActionEvent e) { // MarkerColors markerColors = (MarkerColors) markColor.getSelectedItem(); // searchActionForward.setMarkerColors(markerColors); // searchActionBackward.setMarkerColors(markerColors); // markAllFoundAction.setMarkerColors(markerColors); // configuration.setProperty("gui.markColor", markColor.getSelectedItem()); // otrosApplication.setSelectedMarkColors(markerColors); // } // }); markColor.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { MarkerColors markerColors = (MarkerColors) markColor.getSelectedItem(); searchActionForward.setMarkerColors(markerColors); searchActionBackward.setMarkerColors(markerColors); markAllFoundAction.setMarkerColors(markerColors); configuration.setProperty("gui.markColor", markColor.getSelectedItem()); otrosApplication.setSelectedMarkColors(markerColors); } }); markColor.getModel() .setSelectedItem(configuration.get(MarkerColors.class, "gui.markColor", MarkerColors.Aqua)); buttonSearch = new JButton(searchActionForward); buttonSearch.setMnemonic(KeyEvent.VK_N); JButton buttonSearchPrev = new JButton(searchActionBackward); buttonSearchPrev.setMnemonic(KeyEvent.VK_P); enableDisableComponetsForTabs.addComponet(buttonSearch); enableDisableComponetsForTabs.addComponet(buttonSearchPrev); enableDisableComponetsForTabs.addComponet(searchField); enableDisableComponetsForTabs.addComponet(markFound); enableDisableComponetsForTabs.addComponet(markAllFoundButton); enableDisableComponetsForTabs.addComponet(searchMode); enableDisableComponetsForTabs.addComponet(markColor); toolBar.add(searchMode); toolBar.add(searchField); toolBar.add(buttonSearch); toolBar.add(buttonSearchPrev); toolBar.add(markFound); toolBar.add(markAllFoundButton); toolBar.add(markColor); JButton nextMarked = new JButton(new JumpToMarkedAction(otrosApplication, Direction.FORWARD)); nextMarked.setToolTipText(nextMarked.getText()); nextMarked.setText(""); nextMarked.setMnemonic(KeyEvent.VK_E); enableDisableComponetsForTabs.addComponet(nextMarked); toolBar.add(nextMarked); JButton prevMarked = new JButton(new JumpToMarkedAction(otrosApplication, Direction.BACKWARD)); prevMarked.setToolTipText(prevMarked.getText()); prevMarked.setText(""); prevMarked.setMnemonic(KeyEvent.VK_R); enableDisableComponetsForTabs.addComponet(prevMarked); toolBar.add(prevMarked); enableDisableComponetsForTabs.addComponet(toolBar.add(new SearchByLevel(otrosApplication, 1, Level.INFO))); enableDisableComponetsForTabs .addComponet(toolBar.add(new SearchByLevel(otrosApplication, 1, Level.WARNING))); enableDisableComponetsForTabs .addComponet(toolBar.add(new SearchByLevel(otrosApplication, 1, Level.SEVERE))); enableDisableComponetsForTabs.addComponet(toolBar.add(new SearchByLevel(otrosApplication, -1, Level.INFO))); enableDisableComponetsForTabs .addComponet(toolBar.add(new SearchByLevel(otrosApplication, -1, Level.WARNING))); enableDisableComponetsForTabs .addComponet(toolBar.add(new SearchByLevel(otrosApplication, -1, Level.SEVERE))); }
From source file:com.nikonhacker.gui.EmulatorUI.java
@SuppressWarnings("MagicConstant") protected JMenuBar createMenuBar() { JMenuBar menuBar = new JMenuBar(); JMenuItem tmpMenuItem;//from ww w . ja v a2s .c om //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:org.jab.docsearch.DocSearch.java
private JToolBar createToolBar() { // tool bar// www . ja va 2 s. c o m JToolBar toolBar = new JToolBar(); // file open JButton buttonOpen = new JButton(new ImageIcon(getClass().getResource("/icons/fileopen.png"))); buttonOpen.setToolTipText(I18n.getString("tooltip.open")); buttonOpen.setActionCommand("ac_open"); buttonOpen.addActionListener(this); buttonOpen.setMnemonic(KeyEvent.VK_O); buttonOpen.setEnabled(!env.isWebStart()); // disable in WebStart toolBar.add(buttonOpen); // file save JButton buttonSave = new JButton(new ImageIcon(getClass().getResource("/icons/filesave.png"))); buttonSave.setToolTipText(I18n.getString("tooltip.save")); buttonSave.setActionCommand("ac_save"); buttonSave.addActionListener(this); buttonSave.setMnemonic(KeyEvent.VK_S); buttonSave.setEnabled(!env.isWebStart()); // disable in WebStart toolBar.add(buttonSave); toolBar.addSeparator(); // open browser JButton buttonBrowser = new JButton(new ImageIcon(getClass().getResource("/icons/html.png"))); buttonBrowser.setToolTipText(I18n.getString("tooltip.open_in_browser")); buttonBrowser.setActionCommand("ac_openinbrowser"); buttonBrowser.addActionListener(this); buttonBrowser.setMnemonic(KeyEvent.VK_E); buttonBrowser.setEnabled(!env.isWebStart()); // disable in WebStart toolBar.add(buttonBrowser); toolBar.addSeparator(); // home JButton buttonHome = new JButton(new ImageIcon(getClass().getResource("/icons/home.png"))); buttonHome.setToolTipText(I18n.getString("tooltip.home")); buttonHome.setActionCommand("ac_home"); buttonHome.addActionListener(this); buttonHome.setMnemonic(KeyEvent.VK_H); toolBar.add(buttonHome); // refresh JButton buttonRefresh = new JButton(new ImageIcon(getClass().getResource("/icons/refresh.png"))); buttonRefresh.setToolTipText(I18n.getString("tooltip.refresh")); buttonRefresh.setActionCommand("ac_refresh"); buttonRefresh.addActionListener(this); buttonRefresh.setMnemonic(KeyEvent.VK_L); toolBar.add(buttonRefresh); toolBar.addSeparator(); // result JButton buttonResult = new JButton(new ImageIcon(getClass().getResource("/icons/search_results.png"))); buttonResult.setToolTipText(I18n.getString("tooltip.results")); buttonResult.setActionCommand("ac_result"); buttonResult.addActionListener(this); buttonResult.setMnemonic(KeyEvent.VK_R); toolBar.add(buttonResult); toolBar.addSeparator(); // bookmark JButton buttonBookMark = new JButton(new ImageIcon(getClass().getResource("/icons/bookmark.png"))); buttonBookMark.setToolTipText(I18n.getString("tooltip.add_bookmark")); buttonBookMark.setActionCommand("ac_addbookmark"); buttonBookMark.addActionListener(this); buttonBookMark.setMnemonic(KeyEvent.VK_M); toolBar.add(buttonBookMark); toolBar.addSeparator(); // print JButton buttonPrint = new JButton(new ImageIcon(getClass().getResource("/icons/fileprint.png"))); buttonPrint.setToolTipText(I18n.getString("tooltip.print")); buttonPrint.setActionCommand("ac_print"); buttonPrint.addActionListener(this); buttonPrint.setMnemonic(KeyEvent.VK_P); toolBar.add(buttonPrint); toolBar.addSeparator(); // setting JButton buttonSetting = new JButton(new ImageIcon(getClass().getResource("/icons/configure.png"))); buttonSetting.setToolTipText(I18n.getString("tooltip.settings")); buttonSetting.setActionCommand("ac_settings"); buttonSetting.addActionListener(this); buttonSetting.setMnemonic(KeyEvent.VK_HOME); toolBar.add(buttonSetting); toolBar.addSeparator(); // stop buttonStop = new JButton(new ImageIcon(getClass().getResource("/icons/stop.png"))); buttonStop.setToolTipText(I18n.getString("tooltip.stop")); buttonStop.setActionCommand("ac_stop"); buttonStop.addActionListener(this); buttonStop.setMnemonic(KeyEvent.VK_X); toolBar.add(buttonStop); toolBar.addSeparator(); // toolBar.setFloatable(false); // finished return toolBar; }
From source file:edu.harvard.mcz.imagecapture.MainFrame.java
private JMenuItem getJMenuItemReconcileFiles() { if (jMenuItemReconcileFiles == null) { jMenuItemReconcileFiles = new JMenuItem(); jMenuItemReconcileFiles.setText("Reconcile image files with database"); jMenuItemReconcileFiles.setMnemonic(KeyEvent.VK_R); jMenuItemReconcileFiles.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { JobFileReconciliation r = new JobFileReconciliation(); (new Thread(r)).start(); }/* www .j a v a 2 s.c om*/ }); } return jMenuItemReconcileFiles; }
From source file:org.sikuli.ide.SikuliIDE.java
private void initRunMenu() throws NoSuchMethodException { JMenuItem item;// w w w. jav a 2s . co m int scMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); _runMenu.setMnemonic(java.awt.event.KeyEvent.VK_R); item = _runMenu.add(createMenuItem(_I("menuRunRun"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, scMask), new RunAction(RunAction.RUN))); item.setName("RUN"); item = _runMenu.add(createMenuItem(_I("menuRunRunAndShowActions"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, InputEvent.ALT_MASK | scMask), new RunAction(RunAction.RUN_SHOW_ACTIONS))); item.setName("RUN_SLOWLY"); PreferencesUser pref = PreferencesUser.getInstance(); item = createMenuItem(_I("menuRunStop"), KeyStroke.getKeyStroke(pref.getStopHotkey(), pref.getStopHotkeyModifiers()), new RunAction(RunAction.RUN_SHOW_ACTIONS)); item.setEnabled(false); _runMenu.add(item); }
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.// ww w. j a va 2s . co 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(); }
From source file:edu.harvard.mcz.imagecapture.MainFrame.java
/** * This method initializes jMenuItem // w ww . ja v a 2s.c o m * * @return javax.swing.JMenuItem */ private JMenuItem getJMenuItemRedoOCROne() { if (jMenuItemRedoOCROne == null) { jMenuItemRedoOCROne = new JMenuItem(); jMenuItemRedoOCROne.setText("Redo OCR for A Directory"); jMenuItemRedoOCROne.setMnemonic(KeyEvent.VK_R); try { jMenuItemRedoOCROne.setIcon(new ImageIcon(this.getClass() .getResource("/edu/harvard/mcz/imagecapture/resources/reload_icon_16px.png"))); } catch (Exception e) { log.error("Can't open icon file for jMenuItemRedoOCROne."); log.error(e); } jMenuItemRedoOCROne.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { File target = new File(Singleton.getSingletonInstance().getProperties().getProperties() .getProperty(ImageCaptureProperties.KEY_IMAGEBASE)); JobRepeatOCR r = new JobRepeatOCR(JobRepeatOCR.SCAN_SELECT, target); (new Thread(r)).start(); } }); } return jMenuItemRedoOCROne; }
From source file:savant.view.swing.Savant.java
private void initMenu() { loadGenomeItem.setAccelerator(//from w ww . j av a 2 s.co m javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, MiscUtils.MENU_MASK)); loadFromFileItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, MiscUtils.MENU_MASK)); loadFromURLItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, MiscUtils.MENU_MASK)); loadFromDataSourcePluginItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, MiscUtils.MENU_MASK)); openProjectItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, MiscUtils.MENU_MASK)); saveProjectItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, MiscUtils.MENU_MASK)); saveProjectAsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK)); formatItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, MiscUtils.MENU_MASK)); exitItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, MiscUtils.MENU_MASK)); undoItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, MiscUtils.MENU_MASK)); redoItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, MiscUtils.MENU_MASK)); bookmarkItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, MiscUtils.MENU_MASK)); navigationItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK | MiscUtils.MENU_MASK)); panLeftItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_LEFT, java.awt.event.InputEvent.SHIFT_MASK)); panRightItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_RIGHT, java.awt.event.InputEvent.SHIFT_MASK)); zoomInItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_UP, java.awt.event.InputEvent.SHIFT_MASK)); zoomOutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DOWN, java.awt.event.InputEvent.SHIFT_MASK)); toStartItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_HOME, java.awt.event.InputEvent.SHIFT_MASK)); toEndItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_END, java.awt.event.InputEvent.SHIFT_MASK)); preferencesItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, MiscUtils.MENU_MASK)); crosshairItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_J, MiscUtils.MENU_MASK)); plumblineItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, MiscUtils.MENU_MASK)); spotlightItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, MiscUtils.MENU_MASK)); bookmarksItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK)); genomeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK)); rulerItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK)); statusBarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK)); pluginToolbarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK)); exportItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, MiscUtils.MENU_MASK)); if (!Desktop.isDesktopSupported() || !Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { tutorialsItem.setEnabled(false); userManualItem.setEnabled(false); websiteItem.setEnabled(false); } initBrowseMenu(); try { RecentTracksController.getInstance().populateMenu(recentTrackMenu); RecentProjectsController.getInstance().populateMenu(recentProjectMenu); } catch (IOException ex) { LOG.error("Unable to populate Recent Items menu.", ex); } }