private void initComponents() { java.awt.GridBagConstraints gridBagConstraints;  m_filechooserDictionary = new javax.swing.JFileChooser(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); m_textLanguage0 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); m_textLanguage1 = new javax.swing.JTextField(); m_textDescription = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); m_tableWords = new javax.swing.JTable(); m_buttonAdd = new javax.swing.JButton(); m_buttonRemove = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); m_labelStatusWords = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jMenuBar2 = new javax.swing.JMenuBar(); jMenu2 = new javax.swing.JMenu(); m_menuFileNew = new javax.swing.JMenuItem(); m_menuFileOpen = new javax.swing.JMenuItem(); m_menuFileSave = new javax.swing.JMenuItem(); m_menuFileSaveas = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); m_menuFileClose = new javax.swing.JMenuItem(); jMenu1 = new javax.swing.JMenu(); m_menuEditAdd = new javax.swing.JMenuItem(); m_menuEditRemove = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JSeparator(); m_menuEditAddwordsfromanotherdictionary = new javax.swing.JMenuItem(); jSeparator3 = new javax.swing.JSeparator(); m_menuEditFind = new javax.swing.JMenuItem(); m_menuEditFindAgain = new javax.swing.JMenuItem();   setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("MyLang - Editor"); setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("resources/logo16x16.png"))); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { formWindowClosing(e); } });  jPanel2.setLayout(new java.awt.GridBagLayout());  jLabel1.setDisplayedMnemonic('L'); jLabel1.setLabelFor(m_textLanguage0); jLabel1.setText("Languages"); jLabel1.setFocusable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(jLabel1, gridBagConstraints);  m_textLanguage0.setToolTipText("<HTML>Name of the first language of the dictionary.</HTML>"); m_textLanguage0.setFocusAccelerator('L'); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(m_textLanguage0, gridBagConstraints);  jLabel3.setDisplayedMnemonic('D'); jLabel3.setLabelFor(m_textDescription); jLabel3.setText("Description"); jLabel3.setFocusable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(jLabel3, gridBagConstraints);  m_textLanguage1.setToolTipText("<HTML>Name of the second language of the dictionary.</HTML>"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(m_textLanguage1, gridBagConstraints);  m_textDescription.setToolTipText("<HTML>Short description of the dictionary.</HTML>"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(m_textDescription, gridBagConstraints);  jLabel4.setDisplayedMnemonic('W'); jLabel4.setLabelFor(m_tableWords); jLabel4.setText("Words"); jLabel4.setFocusable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(jLabel4, gridBagConstraints);  jPanel1.setLayout(new java.awt.GridBagLayout());  jScrollPane1.setToolTipText("<HTML>Table of all words contained in the dictionary.</HTML>"); m_tableWords.setModel(new WordsEditorTableModel()); m_tableWords.setSurrendersFocusOnKeystroke(true); m_tableWords.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent e) { m_tableWordsKeyPressed(e); } });  jScrollPane1.setViewportView(m_tableWords);  gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridheight = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel1.add(jScrollPane1, gridBagConstraints);  m_buttonAdd.setMnemonic('A'); m_buttonAdd.setText("Add"); m_buttonAdd.setToolTipText("<HTML>Adds new word to the table.</HTML>"); m_buttonAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_buttonAddActionPerformed(e); } });  gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel1.add(m_buttonAdd, gridBagConstraints);  m_buttonRemove.setMnemonic('R'); m_buttonRemove.setText("Remove"); m_buttonRemove.setToolTipText("<HTML>Removes all selected words from the table.</HTML>"); m_buttonRemove.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_buttonRemoveActionPerformed(e); } });  gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel1.add(m_buttonRemove, gridBagConstraints);  gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel2.add(jPanel1, gridBagConstraints);  getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);  jPanel3.setLayout(new java.awt.GridBagLayout());  m_labelStatusWords.setText("Words: 0"); m_labelStatusWords.setBorder(new javax.swing.border.LineBorder(javax.swing.UIManager.getDefaults().getColor("controlShadow"))); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.ipadx = 2; gridBagConstraints.ipady = 2; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 1); jPanel3.add(m_labelStatusWords, gridBagConstraints);  jPanel4.setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.LineBorder(javax.swing.UIManager.getDefaults().getColor("controlShadow")), new javax.swing.border.EmptyBorder(new java.awt.Insets(1, 1, 1, 1)))); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 1, 2, 2); jPanel3.add(jPanel4, gridBagConstraints);  getContentPane().add(jPanel3, java.awt.BorderLayout.SOUTH);  jMenu2.setMnemonic('F'); jMenu2.setText("File"); m_menuFileNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); m_menuFileNew.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/New16.gif"))); m_menuFileNew.setText("New"); m_menuFileNew.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuFileNewActionPerformed(e); } });  jMenu2.add(m_menuFileNew);  m_menuFileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK)); m_menuFileOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Open16.gif"))); m_menuFileOpen.setText("Open..."); m_menuFileOpen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuFileOpenActionPerformed(e); } });  jMenu2.add(m_menuFileOpen);  m_menuFileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); m_menuFileSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Save16.gif"))); m_menuFileSave.setText("Save"); m_menuFileSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuFileSaveActionPerformed(e); } });  jMenu2.add(m_menuFileSave);  m_menuFileSaveas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/SaveAs16.gif"))); m_menuFileSaveas.setText("Save as..."); m_menuFileSaveas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuFileSaveasActionPerformed(e); } });  jMenu2.add(m_menuFileSaveas);  jMenu2.add(jSeparator1);  m_menuFileClose.setText("Close"); m_menuFileClose.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuFileCloseActionPerformed(e); } });  jMenu2.add(m_menuFileClose);  jMenuBar2.add(jMenu2);  jMenu1.setMnemonic('E'); jMenu1.setText("Edit"); m_menuEditAdd.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_INSERT, 0)); m_menuEditAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/RowInsertAfter16.gif"))); m_menuEditAdd.setText("Add"); m_menuEditAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuEditAddActionPerformed(e); } });  jMenu1.add(m_menuEditAdd);  m_menuEditRemove.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DELETE, java.awt.event.InputEvent.ALT_MASK)); m_menuEditRemove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/RowDelete16.gif"))); m_menuEditRemove.setText("Remove"); m_menuEditRemove.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuEditRemoveActionPerformed(e); } });  jMenu1.add(m_menuEditRemove);  jMenu1.add(jSeparator2);  m_menuEditAddwordsfromanotherdictionary.setText("Add words from another dictionary..."); m_menuEditAddwordsfromanotherdictionary.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuEditAddwordsfromanotherdictionaryActionPerformed(e); } });  jMenu1.add(m_menuEditAddwordsfromanotherdictionary);  jMenu1.add(jSeparator3);  m_menuEditFind.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK)); m_menuEditFind.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Find16.gif"))); m_menuEditFind.setText("Find..."); m_menuEditFind.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuEditFindActionPerformed(e); } });  jMenu1.add(m_menuEditFind);  m_menuEditFindAgain.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F3, 0)); m_menuEditFindAgain.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/FindAgain16.gif"))); m_menuEditFindAgain.setText("Find again"); m_menuEditFindAgain.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { m_menuEditFindAgainActionPerformed(e); } });  jMenu1.add(m_menuEditFindAgain);  jMenuBar2.add(jMenu1);  setJMenuBar(jMenuBar2);  pack(); }
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints;  m_filechooserDictionary = new javax.swing.JFileChooser(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); m_textLanguage0 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); m_textLanguage1 = new javax.swing.JTextField(); m_textDescription = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); m_tableWords = new javax.swing.JTable() { public boolean getScrollableTracksViewportHeight() { java.awt.Component parent = getParent(); if (parent instanceof javax.swing.JViewport) return parent.getHeight() > getPreferredSize().getHeight(); return false; } };  m_buttonAdd = new javax.swing.JButton(); m_buttonRemove = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); m_labelStatusWords = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jMenuBar2 = new javax.swing.JMenuBar(); jMenu2 = new javax.swing.JMenu(); m_menuFileNew = new javax.swing.JMenuItem(); m_menuFileOpen = new javax.swing.JMenuItem(); m_menuFileSave = new javax.swing.JMenuItem(); m_menuFileSaveas = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); m_menuFileClose = new javax.swing.JMenuItem(); jMenu1 = new javax.swing.JMenu(); m_menuEditAdd = new javax.swing.JMenuItem(); m_menuEditRemove = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JSeparator(); m_menuEditAddwordsfromanotherdictionary = new javax.swing.JMenuItem(); jSeparator3 = new javax.swing.JSeparator(); m_menuEditFind = new javax.swing.JMenuItem(); m_menuEditFindAgain = new javax.swing.JMenuItem();  setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("MyLang - Editor"); setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("resources/logo16x16.png"))); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } });  jPanel2.setLayout(new java.awt.GridBagLayout());  jLabel1.setDisplayedMnemonic('L'); jLabel1.setLabelFor(m_textLanguage0); jLabel1.setText("Languages"); jLabel1.setFocusable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(jLabel1, gridBagConstraints);  m_textLanguage0.setToolTipText("<HTML>Name of the first language of the dictionary.</HTML>"); m_textLanguage0.setFocusAccelerator('L'); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(m_textLanguage0, gridBagConstraints);  jLabel3.setDisplayedMnemonic('D'); jLabel3.setLabelFor(m_textDescription); jLabel3.setText("Description"); jLabel3.setFocusable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(jLabel3, gridBagConstraints);  m_textLanguage1.setToolTipText("<HTML>Name of the second language of the dictionary.</HTML>"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(m_textLanguage1, gridBagConstraints);  m_textDescription.setToolTipText("<HTML>Short description of the dictionary.</HTML>"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(m_textDescription, gridBagConstraints);  jLabel4.setDisplayedMnemonic('W'); jLabel4.setLabelFor(m_tableWords); jLabel4.setText("Words"); jLabel4.setFocusable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel2.add(jLabel4, gridBagConstraints);  jPanel1.setLayout(new java.awt.GridBagLayout());  jScrollPane1.setToolTipText("<HTML>Table of all words contained in the dictionary.</HTML>"); m_tableWords.setModel(new WordsEditorTableModel()); m_tableWords.setSurrendersFocusOnKeystroke(true); m_tableWords.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { m_tableWordsKeyPressed(evt); } });  jScrollPane1.setViewportView(m_tableWords);  gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridheight = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel1.add(jScrollPane1, gridBagConstraints);  m_buttonAdd.setMnemonic('A'); m_buttonAdd.setText("Add"); m_buttonAdd.setToolTipText("<HTML>Adds new word to the table.</HTML>"); m_buttonAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_buttonAddActionPerformed(evt); } });  gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel1.add(m_buttonAdd, gridBagConstraints);  m_buttonRemove.setMnemonic('R'); m_buttonRemove.setText("Remove"); m_buttonRemove.setToolTipText("<HTML>Removes all selected words from the table.</HTML>"); m_buttonRemove.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_buttonRemoveActionPerformed(evt); } });  gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); jPanel1.add(m_buttonRemove, gridBagConstraints);  gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel2.add(jPanel1, gridBagConstraints);  getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);  jPanel3.setLayout(new java.awt.GridBagLayout());  m_labelStatusWords.setText("Words: 0"); m_labelStatusWords.setBorder(new javax.swing.border.LineBorder(javax.swing.UIManager.getDefaults().getColor("controlShadow"))); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.ipadx = 2; gridBagConstraints.ipady = 2; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 1); jPanel3.add(m_labelStatusWords, gridBagConstraints);  jPanel4.setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.LineBorder(javax.swing.UIManager.getDefaults().getColor("controlShadow")), new javax.swing.border.EmptyBorder(new java.awt.Insets(1, 1, 1, 1)))); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 1, 2, 2); jPanel3.add(jPanel4, gridBagConstraints);  getContentPane().add(jPanel3, java.awt.BorderLayout.SOUTH);  jMenu2.setMnemonic('F'); jMenu2.setText("File"); m_menuFileNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); m_menuFileNew.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/New16.gif"))); m_menuFileNew.setText("New"); m_menuFileNew.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuFileNewActionPerformed(evt); } });  jMenu2.add(m_menuFileNew);  m_menuFileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK)); m_menuFileOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Open16.gif"))); m_menuFileOpen.setText("Open..."); m_menuFileOpen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuFileOpenActionPerformed(evt); } });  jMenu2.add(m_menuFileOpen);  m_menuFileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); m_menuFileSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Save16.gif"))); m_menuFileSave.setText("Save"); m_menuFileSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuFileSaveActionPerformed(evt); } });  jMenu2.add(m_menuFileSave);  m_menuFileSaveas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/SaveAs16.gif"))); m_menuFileSaveas.setText("Save as..."); m_menuFileSaveas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuFileSaveasActionPerformed(evt); } });  jMenu2.add(m_menuFileSaveas);  jMenu2.add(jSeparator1);  m_menuFileClose.setText("Close"); m_menuFileClose.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuFileCloseActionPerformed(evt); } });  jMenu2.add(m_menuFileClose);  jMenuBar2.add(jMenu2);  jMenu1.setMnemonic('E'); jMenu1.setText("Edit"); m_menuEditAdd.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_INSERT, 0)); m_menuEditAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/RowInsertAfter16.gif"))); m_menuEditAdd.setText("Add"); m_menuEditAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuEditAddActionPerformed(evt); } });  jMenu1.add(m_menuEditAdd);  m_menuEditRemove.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DELETE, java.awt.event.InputEvent.ALT_MASK)); m_menuEditRemove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/RowDelete16.gif"))); m_menuEditRemove.setText("Remove"); m_menuEditRemove.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuEditRemoveActionPerformed(evt); } });  jMenu1.add(m_menuEditRemove);  jMenu1.add(jSeparator2);  m_menuEditAddwordsfromanotherdictionary.setText("Add words from another dictionary..."); m_menuEditAddwordsfromanotherdictionary.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuEditAddwordsfromanotherdictionaryActionPerformed(evt); } });  jMenu1.add(m_menuEditAddwordsfromanotherdictionary);  jMenu1.add(jSeparator3);  m_menuEditFind.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK)); m_menuEditFind.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Find16.gif"))); m_menuEditFind.setText("Find..."); m_menuEditFind.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuEditFindActionPerformed(evt); } });  jMenu1.add(m_menuEditFind);  m_menuEditFindAgain.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F3, 0)); m_menuEditFindAgain.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/FindAgain16.gif"))); m_menuEditFindAgain.setText("Find again"); m_menuEditFindAgain.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_menuEditFindAgainActionPerformed(evt); } });  jMenu1.add(m_menuEditFindAgain);  jMenuBar2.add(jMenu1);  setJMenuBar(jMenuBar2);  pack(); }
	private void initComponents()//GEN-BEGIN:initComponents	{		java.awt.GridBagConstraints gridBagConstraints;				m_filechooserDictionary = new javax.swing.JFileChooser();		jPanel2 = new javax.swing.JPanel();		jLabel1 = new javax.swing.JLabel();		m_textLanguage0 = new javax.swing.JTextField();		jLabel3 = new javax.swing.JLabel();		m_textLanguage1 = new javax.swing.JTextField();		m_textDescription = new javax.swing.JTextField();		jLabel4 = new javax.swing.JLabel();		jPanel1 = new javax.swing.JPanel();		jScrollPane1 = new javax.swing.JScrollPane();		m_tableWords = new javax.swing.JTable();		m_buttonAdd = new javax.swing.JButton();		m_buttonRemove = new javax.swing.JButton();		jPanel3 = new javax.swing.JPanel();		m_labelStatusWords = new javax.swing.JLabel();		jPanel4 = new javax.swing.JPanel();		jMenuBar2 = new javax.swing.JMenuBar();		jMenu2 = new javax.swing.JMenu();		m_menuFileNew = new javax.swing.JMenuItem();		m_menuFileOpen = new javax.swing.JMenuItem();		m_menuFileSave = new javax.swing.JMenuItem();		m_menuFileSaveas = new javax.swing.JMenuItem();		jSeparator1 = new javax.swing.JSeparator();		m_menuFileClose = new javax.swing.JMenuItem();		jMenu1 = new javax.swing.JMenu();		m_menuEditAdd = new javax.swing.JMenuItem();		m_menuEditRemove = new javax.swing.JMenuItem();		jSeparator2 = new javax.swing.JSeparator();		m_menuEditAddwordsfromanotherdictionary = new javax.swing.JMenuItem();		jSeparator3 = new javax.swing.JSeparator();		m_menuEditFind = new javax.swing.JMenuItem();		m_menuEditFindAgain = new javax.swing.JMenuItem();						setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);		setTitle("MyLang - Editor");		setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("resources/logo16x16.png")));		addWindowListener(new java.awt.event.WindowAdapter()		{			public void windowClosing(java.awt.event.WindowEvent e)			{				formWindowClosing(e);			}		});				jPanel2.setLayout(new java.awt.GridBagLayout());				jLabel1.setDisplayedMnemonic('L');		jLabel1.setLabelFor(m_textLanguage0);		jLabel1.setText("Languages");		jLabel1.setFocusable(false);		gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridx = 0;		gridBagConstraints.gridy = 0;		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel2.add(jLabel1, gridBagConstraints);				m_textLanguage0.setToolTipText("<HTML>Name of the first language of the dictionary.</HTML>");		m_textLanguage0.setFocusAccelerator('L');		gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridx = 1;		gridBagConstraints.gridy = 0;		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;		gridBagConstraints.weightx = 1.0;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel2.add(m_textLanguage0, gridBagConstraints);				jLabel3.setDisplayedMnemonic('D');		jLabel3.setLabelFor(m_textDescription);		jLabel3.setText("Description");		jLabel3.setFocusable(false);		gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridx = 0;		gridBagConstraints.gridy = 1;		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel2.add(jLabel3, gridBagConstraints);				m_textLanguage1.setToolTipText("<HTML>Name of the second language of the dictionary.</HTML>");		gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridx = 2;		gridBagConstraints.gridy = 0;		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;		gridBagConstraints.weightx = 1.0;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel2.add(m_textLanguage1, gridBagConstraints);				m_textDescription.setToolTipText("<HTML>Short description of the dictionary.</HTML>");		gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridx = 1;		gridBagConstraints.gridy = 1;		gridBagConstraints.gridwidth = 2;		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;		gridBagConstraints.weightx = 1.0;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel2.add(m_textDescription, gridBagConstraints);				jLabel4.setDisplayedMnemonic('W');		jLabel4.setLabelFor(m_tableWords);		jLabel4.setText("Words");		jLabel4.setFocusable(false);		gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridx = 0;		gridBagConstraints.gridy = 2;		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;		gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel2.add(jLabel4, gridBagConstraints);				jPanel1.setLayout(new java.awt.GridBagLayout());				jScrollPane1.setToolTipText("<HTML>Table of all words contained in the dictionary.</HTML>");		m_tableWords.setModel(new WordsEditorTableModel());		m_tableWords.setSurrendersFocusOnKeystroke(true);		m_tableWords.addKeyListener(new java.awt.event.KeyAdapter()		{			public void keyPressed(java.awt.event.KeyEvent e)			{				m_tableWordsKeyPressed(e);			}		});				jScrollPane1.setViewportView(m_tableWords);				gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridheight = 3;		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;		gridBagConstraints.weightx = 1.0;		gridBagConstraints.weighty = 1.0;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel1.add(jScrollPane1, gridBagConstraints);				m_buttonAdd.setMnemonic('A');		m_buttonAdd.setText("Add");		m_buttonAdd.setToolTipText("<HTML>Adds new word to the table.</HTML>");		m_buttonAdd.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_buttonAddActionPerformed(e);			}		});				gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel1.add(m_buttonAdd, gridBagConstraints);				m_buttonRemove.setMnemonic('R');		m_buttonRemove.setText("Remove");		m_buttonRemove.setToolTipText("<HTML>Removes all selected words from the table.</HTML>");		m_buttonRemove.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_buttonRemoveActionPerformed(e);			}		});				gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridx = 1;		gridBagConstraints.gridy = 1;		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);		jPanel1.add(m_buttonRemove, gridBagConstraints);				gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.gridx = 1;		gridBagConstraints.gridy = 2;		gridBagConstraints.gridwidth = 2;		gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;		gridBagConstraints.weightx = 1.0;		gridBagConstraints.weighty = 1.0;		jPanel2.add(jPanel1, gridBagConstraints);				getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);				jPanel3.setLayout(new java.awt.GridBagLayout());				m_labelStatusWords.setText("Words: 0");		m_labelStatusWords.setBorder(new javax.swing.border.LineBorder(javax.swing.UIManager.getDefaults().getColor("controlShadow")));		gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.ipadx = 2;		gridBagConstraints.ipady = 2;		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 1);		jPanel3.add(m_labelStatusWords, gridBagConstraints);				jPanel4.setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.LineBorder(javax.swing.UIManager.getDefaults().getColor("controlShadow")), new javax.swing.border.EmptyBorder(new java.awt.Insets(1, 1, 1, 1))));		gridBagConstraints = new java.awt.GridBagConstraints();		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;		gridBagConstraints.weightx = 1.0;		gridBagConstraints.insets = new java.awt.Insets(2, 1, 2, 2);		jPanel3.add(jPanel4, gridBagConstraints);				getContentPane().add(jPanel3, java.awt.BorderLayout.SOUTH);				jMenu2.setMnemonic('F');		jMenu2.setText("File");		m_menuFileNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));		m_menuFileNew.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/New16.gif")));		m_menuFileNew.setText("New");		m_menuFileNew.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuFileNewActionPerformed(e);			}		});				jMenu2.add(m_menuFileNew);				m_menuFileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));		m_menuFileOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Open16.gif")));		m_menuFileOpen.setText("Open...");		m_menuFileOpen.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuFileOpenActionPerformed(e);			}		});				jMenu2.add(m_menuFileOpen);				m_menuFileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));		m_menuFileSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Save16.gif")));		m_menuFileSave.setText("Save");		m_menuFileSave.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuFileSaveActionPerformed(e);			}		});				jMenu2.add(m_menuFileSave);				m_menuFileSaveas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/SaveAs16.gif")));		m_menuFileSaveas.setText("Save as...");		m_menuFileSaveas.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuFileSaveasActionPerformed(e);			}		});				jMenu2.add(m_menuFileSaveas);				jMenu2.add(jSeparator1);				m_menuFileClose.setText("Close");		m_menuFileClose.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuFileCloseActionPerformed(e);			}		});				jMenu2.add(m_menuFileClose);				jMenuBar2.add(jMenu2);				jMenu1.setMnemonic('E');		jMenu1.setText("Edit");		m_menuEditAdd.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_INSERT, 0));		m_menuEditAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/RowInsertAfter16.gif")));		m_menuEditAdd.setText("Add");		m_menuEditAdd.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuEditAddActionPerformed(e);			}		});				jMenu1.add(m_menuEditAdd);				m_menuEditRemove.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DELETE, java.awt.event.InputEvent.ALT_MASK));		m_menuEditRemove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/RowDelete16.gif")));		m_menuEditRemove.setText("Remove");		m_menuEditRemove.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuEditRemoveActionPerformed(e);			}		});				jMenu1.add(m_menuEditRemove);				jMenu1.add(jSeparator2);				m_menuEditAddwordsfromanotherdictionary.setText("Add words from another dictionary...");		m_menuEditAddwordsfromanotherdictionary.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuEditAddwordsfromanotherdictionaryActionPerformed(e);			}		});				jMenu1.add(m_menuEditAddwordsfromanotherdictionary);				jMenu1.add(jSeparator3);				m_menuEditFind.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));		m_menuEditFind.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/Find16.gif")));		m_menuEditFind.setText("Find...");		m_menuEditFind.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuEditFindActionPerformed(e);			}		});				jMenu1.add(m_menuEditFind);				m_menuEditFindAgain.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F3, 0));		m_menuEditFindAgain.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mylang/gui/resources/FindAgain16.gif")));		m_menuEditFindAgain.setText("Find again");		m_menuEditFindAgain.addActionListener(new java.awt.event.ActionListener()		{			public void actionPerformed(java.awt.event.ActionEvent e)			{				m_menuEditFindAgainActionPerformed(e);			}		});				jMenu1.add(m_menuEditFindAgain);				jMenuBar2.add(jMenu1);				setJMenuBar(jMenuBar2);				pack();	}//GEN-END:initComponents