@Override public void focusGained(FocusEvent e) { editorComponent.selectAll(); } });
public void focusGained(FocusEvent e) { String value=field.getText(); if(value != null && !value.isEmpty()) { field.selectAll(); } }
@Override public void actionPerformed(ActionEvent ae) { try { final String localHost = InetAddress.getLocalHost().getHostName(); jtf_workstation.setText(localHost); jtf_workstation.selectAll(); jtf_workstation.requestFocus(); } catch(UnknownHostException ex) { throw new RuntimeException(ex); } } });
public void showFindBox() { this.setVisible(true); this.textField.requestFocus(); this.textField.selectAll(); }
@Override protected void openInit() { prepare(); String lastSearch = cache.getLastSearch(); if (lastSearch != null) { searchField.setText(lastSearch); searchField.selectAll(); searchEmitter.emitSearch(); } searchField.requestFocus(); }
public void mouseClicked(MouseEvent e) { send(txtField.getText()); txtField.selectAll(); } });
@Override public void focusGained(FocusEvent e) { nameInput.getTextField().selectAll(); }
public boolean toggle() { boolean visible = !isVisible(); setVisible(visible); if (visible) { searchField.requestFocus(); searchField.selectAll(); } else { rTextArea.requestFocus(); } return visible; }
private void createView() { JPanel controlsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 10)); serverTextField = new JTextField(""); serverTextField.setColumns(15); serverTextField.selectAll(); JPanel textPanel = new JPanel(new GridLayout(4, 2, 0, 10)); textPanel.add(new JLabel("Go Server Hostname or IP")); textPanel.add(serverTextField); textPanel.add(new JLabel("SSL Mode")); sslModeComponent = new SslModeComponent(); textPanel.add(sslModeComponent); textPanel.add(new JLabel("Server root certificate")); fileBrowser = new FileBrowser(); textPanel.add(fileBrowser); controlsPanel.add(textPanel); getContentPane().add(controlsPanel, BorderLayout.NORTH); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 10)); okButton = new JButton("OK"); buttonPanel.add(okButton); getContentPane().add(buttonPanel, BorderLayout.SOUTH); }
private void updateNameActions(boolean saveAndCancel) { save.setVisible(saveAndCancel); cancel.setVisible(saveAndCancel); rename.setVisible(!saveAndCancel); if (saveAndCancel) { nameInput.getTextField().requestFocusInWindow(); nameInput.getTextField().selectAll(); } }
@Override public void focusGained(FocusEvent e) { displayInput.getTextField().setForeground(INACTIVE_CLOCK_COLOR); displayInput.getTextField().selectAll(); }
public void ask() { AgentBootstrapperArgs bootstrapperArgs = agentMacWindow.getBootstrapperArgs(); this.serverTextField.setText(bootstrapperArgs.getServerUrl().toString()); this.fileBrowser.setFile(bootstrapperArgs.getRootCertFile()); this.sslModeComponent.setSslMode(bootstrapperArgs.getSslMode()); serverTextField.selectAll(); serverTextField.grabFocus(); setVisible(true); }
if(cmd != null && !cmd.isEmpty()) { send(txtField.getText()); txtField.selectAll();
/** * Set the text on the input line. * @param text the new text */ public void setInputText(final String text) { textField.setText(text); textField.selectAll(); }
KeyboardFocusManager.getCurrentKeyboardFocusManager() .addPropertyChangeListener("permanentFocusOwner", new PropertyChangeListener() { public void propertyChange(final PropertyChangeEvent e) { if (e.getNewValue() instanceof JTextField) { SwingUtilities.invokeLater(new Runnable() { public void run() { JTextField textField = (JTextField)e.getNewValue(); textField.selectAll(); } }); } } });
@Override public void mouseClicked(MouseEvent e) { if( e.getClickCount() == 1 ) { if( null != txtLocation.getSelectedText() || txtLocation.isFocusOwner() ) return; txtLocation.selectAll(); } }
/** * Select all textfield content when focused. */ public static void addTextFieldShortcutSelectAll() { KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener( "permanentFocusOwner", propertyChangeEvent -> { if (propertyChangeEvent.getNewValue() instanceof JTextField) { SwingUtilities.invokeLater(() -> { JTextField textField = (JTextField) propertyChangeEvent.getNewValue(); textField.selectAll(); }); } } ); }
private void showNumberField() { numberField.setText(valueAsString()); numberField.setVisible(true); numberField.requestFocus(); numberField.selectAll(); componentResized(null); repaint(); }
MediatorGui.panelAddressBar().getTextFieldAddress().selectAll(); this.wasAltDPressed[0] = true;
public void actionPerformed(ActionEvent e) { String cmd=e.getActionCommand(); if(cmd != null && cmd.length() > 0) { send(txtField.getText()); txtField.selectAll(); } } });