Package javax.swing

Examples of javax.swing.JTextField.selectAll()


            if (c instanceof JTextField) {
                final JTextField jtf = (JTextField) c;
                jtf.addFocusListener( new FocusListener() {
                    @Override
                    public void focusGained ( FocusEvent e ) {
                        jtf.selectAll();
                    }

                    @Override
                    public void focusLost ( FocusEvent e ) {
                        //do nothing
View Full Code Here


            nl.setToolTipText("<html><b>enter the node name or ip</b><br>node"
                              + i + "<br>or ...<br>"
                              + System.getProperty("user.name")
                              + "@node" + i + ":22..." + "<br>");
            hostsTF.add(nl);
            nl.selectAll();
            final Font font = nl.getFont();
            final Font newFont = font.deriveFont(Font.PLAIN, (float) (font.getSize() / 1.2));
            nl.setFont(newFont);
            label.add(nl);
        }
View Full Code Here

                }
                popup.setLocation((int) (l.getX() + menu.getBounds().getWidth()), (int) l.getY() - 1);
                popup.pack();
                popup.setVisible(true);
                typeToSearchField.requestFocus();
                typeToSearchField.selectAll();
                /* Setting location again. Moving it one pixel fixes
                the "gray window" problem. */
                popup.setLocation((int) (l.getX() + menu.getBounds().getWidth()), (int) l.getY());
            }
        });
View Full Code Here

          SwingUtilities.invokeLater(new Runnable()
          {
            public void run()
            {
              JTextField textField = (JTextField)e.getNewValue();
              textField.selectAll();
            }
          });

        }
      }
View Full Code Here

                    }
                }
                JTextField c = (JTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
                c.setBorder(BorderFactory.createEmptyBorder());
                c.setFont(table.getFont());
                c.selectAll();
                return c;
            }

            @Override
            public void cancelCellEditing() {
View Full Code Here

                    }
                }
                JTextField c = (JTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
                c.setBorder(BorderFactory.createEmptyBorder());
                c.setFont(table.getFont());
                c.selectAll();
                return c;
            }

            @Override
            public void cancelCellEditing() {
View Full Code Here

    private static class SelectAllOnFocusHandler extends FocusAdapter {
        @Override
        public void focusGained(FocusEvent e) {
            if (e.getSource() instanceof JTextField) {
                JTextField tf = (JTextField)e.getSource();
                tf.selectAll();
            }
        }
    }

    /**
 
View Full Code Here

    /** This method performs Edit->Find. */
    private Runner doFind() {
        if (wrap) return wrapMe();
        JTextField x = OurUtil.textfield(lastFind,30);
        x.selectAll();
        JCheckBox c = new JCheckBox("Case Sensitive?",lastFindCaseSensitive);
        c.setMnemonic('c');
        JCheckBox b = new JCheckBox("Search Backward?",!lastFindForward);
        b.setMnemonic('b');
        if (!OurDialog.getInput("Find", "Text:", x, " ", c, b)) return null;
View Full Code Here

    jFormattedTextFocusAdapter = new FocusAdapter() {
      public void focusGained(final FocusEvent ev) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            JTextField jtxt = (JTextField)ev.getSource();
            jtxt.selectAll();
          }
        });
      }
    };
View Full Code Here

    charValueFocusListener = new FocusListener() {
      @Override
      public void focusGained(FocusEvent arg0) {
        JTextField jtxt = (JTextField)arg0.getComponent();
        jtxt.selectAll();
      }
      @Override
      public void focusLost(FocusEvent arg0) {

      }
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.