diff --git a/src/main/java/org/humanistika/oxygen/tei/completer/GUI/newSuggestionForm.form b/src/main/java/org/humanistika/oxygen/tei/completer/GUI/newSuggestionForm.form index 98b2d4b..1d743d5 100644 --- a/src/main/java/org/humanistika/oxygen/tei/completer/GUI/newSuggestionForm.form +++ b/src/main/java/org/humanistika/oxygen/tei/completer/GUI/newSuggestionForm.form @@ -1,10 +1,12 @@ + +
@@ -29,34 +31,31 @@ - + - - - - - - - - - - - - - - - - - + + + + + + + + - + + + + + + + - + @@ -70,16 +69,16 @@ - + - + - + @@ -100,24 +99,15 @@ - + - - - - - - - - - @@ -125,10 +115,15 @@ + + + + + - + @@ -144,8 +139,7 @@ - - +
@@ -162,11 +156,6 @@ - - - <Editor/> - <Renderer/> - </Column> </TableColumnModel> </Property> <Property name="columnSelectionAllowed" type="boolean" value="true"/> diff --git a/src/main/java/org/humanistika/oxygen/tei/completer/GUI/newSuggestionForm.java b/src/main/java/org/humanistika/oxygen/tei/completer/GUI/newSuggestionForm.java index a2cec28..4e699fc 100644 --- a/src/main/java/org/humanistika/oxygen/tei/completer/GUI/newSuggestionForm.java +++ b/src/main/java/org/humanistika/oxygen/tei/completer/GUI/newSuggestionForm.java @@ -84,7 +84,7 @@ private void initComponents() { restultsJTable = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setTitle("Custom lookup"); + cancleJButton.setText("Cancel"); cancleJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -96,16 +96,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jLabel1.setText("Custom lookup"); dependentJLabel.setText("Dependent:"); - dependentJLabel.setToolTipText(""); - - dependentJTextField.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - dependentJTextFieldActionPerformed(evt); - } - }); selectionJLabel.setText("Selection:"); + selectionJTextField.setMinimumSize(new java.awt.Dimension(200, 22)); + fetchjButton.setText("Search..."); fetchjButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -115,16 +110,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { restultsJTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { + }, new String [] { - "Value", "Description" + "Value", "Description" } ) { Class[] types = new Class [] { - java.lang.String.class, java.lang.String.class + java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean [] { - false, false + false, false }; public Class getColumnClass(int columnIndex) { @@ -144,11 +140,6 @@ public void mousePressed(java.awt.event.MouseEvent evt) { jScrollPane2.setViewportView(restultsJTable); restultsJTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); - restultsJTable.setCellSelectionEnabled(false); - restultsJTable.setRowSelectionAllowed(true); - - restultsJTable.getColumnModel().getColumn(0).setPreferredWidth(120); - restultsJTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -159,22 +150,20 @@ public void mousePressed(java.awt.event.MouseEvent evt) { .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(cancleJButton)) - .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jLabel1) - .addGroup(layout.createSequentialGroup() - .addGap(6, 6, 6) - .addComponent(dependentJLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(dependentJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addGap(16, 16, 16) - .addComponent(selectionJLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(selectionJTextField)) - .addComponent(fetchjButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, Short.MAX_VALUE))) + .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 706, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jLabel1) + .addGroup(layout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(selectionJLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(selectionJTextField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(dependentJLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(dependentJTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)) + .addComponent(fetchjButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); layout.setVerticalGroup( @@ -189,7 +178,7 @@ public void mousePressed(java.awt.event.MouseEvent evt) { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selectionJLabel) - .addComponent(selectionJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(selectionJTextField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(8, 8, 8) .addComponent(fetchjButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) @@ -199,6 +188,9 @@ public void mousePressed(java.awt.event.MouseEvent evt) { .addContainerGap()) ); + + // this will break the UI design in netbeans IDE but no alternative + // was found to get the text change event selectionJTextField.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent e) { textChanged(); @@ -238,10 +230,6 @@ private void cancleJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN dispose(); }//GEN-LAST:event_cancleJButtonActionPerformed - private void dependentJTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dependentJTextFieldActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_dependentJTextFieldActionPerformed - private void fetchjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fetchjButtonActionPerformed // TODO add your handling code here: @@ -296,6 +284,7 @@ private void restultsJTableMousePressed(java.awt.event.MouseEvent evt) {//GEN-FI }//GEN-LAST:event_restultsJTableMousePressed + // /** // * @param args the command line arguments // */ @@ -340,13 +329,13 @@ private void restultsJTableMousePressed(java.awt.event.MouseEvent evt) {//GEN-FI // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton cancleJButton; + private javax.swing.JLabel dependentJLabel; private javax.swing.JTextField dependentJTextField; private javax.swing.JButton fetchjButton; private javax.swing.JLabel jLabel1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable restultsJTable; private javax.swing.JLabel selectionJLabel; - private javax.swing.JLabel dependentJLabel; private javax.swing.JTextField selectionJTextField; // End of variables declaration//GEN-END:variables