Package javax.swing

Examples of javax.swing.JTextField.requestFocus()


            String selectedValue = (String) list.getSelectedValue();
            if (selectedValue != null) {
                hidePopup();
                JTextField textField = getTextField();
                textField.setText(selectedValue);
                textField.requestFocus();
            }
            e.consume();
        } else if (keyCode == 27) { //ESC
            hidePopup();
            e.consume();
View Full Code Here


            longVal = Long.parseLong(temp.getText());
        } catch (NumberFormatException err) {
            JOptionPane.showMessageDialog(this, "This field must have a long value!", "Value Required",
                    JOptionPane.ERROR_MESSAGE);
            temp.setText(defaultValue);
            temp.requestFocus();
        }
        return longVal;
    }
}
View Full Code Here

          public void keyPressed(KeyEvent e) {
            switch(e.getKeyCode()) {
              case KeyEvent.VK_UP: {
                  if(tableNamesJList.getSelectedIndex() == 0) {
                    tableNamesJList.clearSelection();
                    tableNameFilterTextField.requestFocus();
                  }
                break;
              }
              case KeyEvent.VK_ENTER: {
                      Object selectedValue = tableNamesJList.getSelectedValue();
View Full Code Here

                @Override
                public void itemStateChanged(ItemEvent e) {
                    boolean isActive = e.getStateChange() == ItemEvent.SELECTED;
                    searchField.setVisible(isActive);
                    if(isActive) {
                        searchField.requestFocus();
                    } else {
                        searchField.setText("");
                        table.requestFocus();
                    }
                    filterPane.revalidate();
View Full Code Here

                @Override
                public void keyPressed(KeyEvent e) {
                    if(e.getKeyCode() == KeyEvent.VK_F && e.isControlDown()) {
                        e.consume();
                        filterToggleButton.setSelected(true);
                        searchField.requestFocus();
                        searchField.selectAll();
                    }
                }
            });
            statusCountPane.add(filterPane);
View Full Code Here

        }
        catch (NumberFormatException err)
        {
            JOptionPane.showMessageDialog(this, "This field must have a long value!", "Value Required", JOptionPane.ERROR_MESSAGE);
            temp.setText(defaultValue);
            temp.requestFocus();
        }
        return longVal;
    }

}
View Full Code Here

            longVal = Long.parseLong(temp.getText());
        } catch (NumberFormatException err) {
            JOptionPane.showMessageDialog(this, "This field must have a long value!", "Value Required",
                    JOptionPane.ERROR_MESSAGE);
            temp.setText(defaultValue);
            temp.requestFocus();
        }
        return longVal;
    }
}
View Full Code Here

        pane.setInitialValue(field);
        JDialog dlog = pane.createDialog(frame, getFromLocale("circuitNameDialogTitle"));
        dlog.addWindowFocusListener(new WindowFocusListener() {
            @Override
            public void windowGainedFocus(WindowEvent arg0) {
                field.requestFocus();
            }

            @Override
            public void windowLostFocus(WindowEvent arg0) { }
        });
View Full Code Here

               
                if (event instanceof KeyEvent) {
                  
                   if (((KeyEvent) event).getModifiers() == Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()
                            && ((KeyEvent) event).getKeyCode() == KeyEvent.VK_F){                              
                               findField.requestFocus();                              
                   }                   
                }                     
            }   
           
        }, AWTEvent.KEY_EVENT_MASK);
View Full Code Here

      longVal = Long.parseLong(temp.getText());
    } catch (NumberFormatException err) {
      JOptionPane.showMessageDialog(this, "This field must have a long value!", "Value Required",
          JOptionPane.ERROR_MESSAGE);
      temp.setText(defaultValue);
      temp.requestFocus();
    }
    return longVal;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.