Package javax.swing.text

Examples of javax.swing.text.JTextComponent.requestFocus()


  private void startEditing() {
    JTextComponent textField = (JTextComponent) combo.getEditor().getEditorComponent();

    combo.setEditable(true);

    textField.requestFocus();

    String text = initialEditValue;
    if (initialEditValue == null)
      text = ""; // will revert to last valid value if invalid
View Full Code Here


            attribs = element.getAttributes();
          }
          baseDocument.remove(searchPlace, findTerm.length());
          baseDocument.insertString(searchPlace, replaceTerm, attribs);
          jtpFindSource.setCaretPosition(searchPlace + replaceTerm.length());
          jtpFindSource.requestFocus();
          jtpFindSource.select(searchPlace, searchPlace + replaceTerm.length());
        }
        else
        {
          jtpFindSource.setCaretPosition(searchPlace + findTerm.length());
View Full Code Here

          jtpFindSource.select(searchPlace, searchPlace + replaceTerm.length());
        }
        else
        {
          jtpFindSource.setCaretPosition(searchPlace + findTerm.length());
          jtpFindSource.requestFocus();
          jtpFindSource.select(searchPlace, searchPlace + findTerm.length());
        }
      }
    }
    catch(BadLocationException ble)
View Full Code Here

                    SwingUtilities.invokeLater(new Runnable()
                    {
                        @Override
                        public void run()
                        {
                            text.requestFocus();
                        }
                    });
                }
            }
        });
View Full Code Here

            addRequestProps(command, OperationDialog.this.props);

            JTextComponent cmdText = cliGuiCtx.getCommandLine().getCmdText();
            cmdText.setText(command.toString());
            OperationDialog.this.dispose();
            cmdText.requestFocus();
        }

        private void addRequestProps(StringBuilder command, SortedSet<RequestProp> reqProps) {
            boolean addedProps = false;
            command.append("(");
View Full Code Here

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        JTextComponent textComponent = (JTextComponent) getInvoker();
        textComponent.requestFocus();

        boolean haveSelection =
                textComponent.getSelectionStart() != textComponent.getSelectionEnd();

        if (e.getSource() == cutItem) {
View Full Code Here

            final JTextComponent text = CopyAction.this
            .getTextComponent(evt);

            text.copy();
            text.requestFocus();

          }

        } // null evt
View Full Code Here

      public void run() {
        final JTextComponent text = SelectAllAction.this
        .getTextComponent(evt);
        if (text != null) {
          text.selectAll();
          text.requestFocus();
        }
      }
    });

  }
View Full Code Here

        final JTextComponent text = PasteAction.this
        .getTextComponent(evt);
        if (text != null) {
          if (text.isEditable()) {
            text.paste();
            text.requestFocus();
          }
        }
      }
    });
View Full Code Here

      public void run() {
        final JTextComponent text = CutAction.this
        .getTextComponent(evt);
        if (text != null) {
          text.cut();
          text.requestFocus();
        }
      }
    });
  }
}
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.