Package javax.swing.event

Examples of javax.swing.event.CaretListener


                                }
                                dispose();
                        }
                });

                CaretListener caretListener = new CaretListener() {
                        public void caretUpdate(CaretEvent e) {
                                updateComponents();
                        }
                };
View Full Code Here


    btnOK = new JButton(UILabelResourceManager.getInstance().getString(TEXT_BUTTON_LOGIN));
    btnOK.setIcon(IconHelper.getLoginIcon());
    btnClose = new JButton(UILabelResourceManager.getInstance().getString(TEXT_BUTTON_CLOSE));
    btnClose.setIcon(IconHelper.getCloseIcon());
   
    txtUserName.addCaretListener(new CaretListener() {
      public void caretUpdate(CaretEvent event) {
        btnOK.setEnabled(txtUserName.getText().trim().length() > 0);
      }
    });
    txtUserName.addActionListener(this);
View Full Code Here

    private JTextArea jTextArea = null;

    public XJTextArea() {
        jTextArea = new JTextArea();
        jTextArea.addCaretListener(new CaretListener() {
            public void caretUpdate(CaretEvent e) {
                keyValueChanged(KV_TEXT_STRING, jTextArea.getText());
            }
        });
    }
View Full Code Here

    this.setSize(d);
   
    this.setToolTipText(text);
   
    this.addCaretListener(
        new CaretListener(){

          @Override
          public void caretUpdate(CaretEvent e) {
            setToolTipText(getText());
          }
View Full Code Here

    JPanel panel = new JPanel(new BorderLayout(12, 12));
    JLabel label = new JLabel("Please specify the location and name of the file to export to.");
    panel.add(label, BorderLayout.NORTH);
    JPanel entryPanel = new JPanel(new BorderLayout(12, 12));
    pathNameField = new JTextField();
    pathNameField.addCaretListener(new CaretListener() {
      /**
       * Called when the caret position is updated.
       *
       * @param e the caret event
       */
 
View Full Code Here

        setLineWrap(true);
        this.printStream = new JTextComponentPrintStream(this, true);
        this.completionHandler = new DefaultCompletionHandler();
        this.inputStream = new JTextComponentInputStream2(this);

        addCaretListener(new CaretListener() {
            public void caretUpdate(CaretEvent e) {
                if (! duringMousePressed) {
                    lastDot = e.getDot();
                }
            }
View Full Code Here

          updatePreview();
        }
      });

    patternEditor.addCaretListener(
      new CaretListener() {
        public void caretUpdate(CaretEvent e) {
          updateTextActions(e.getMark() != e.getDot());
        }
      });
  }
View Full Code Here

    new CaretPositionCorrector(field, jumpCharacters, '\0', startPosition);
  }
 
  /** Create caret listener for making sure of editing the right value.*/
  private void createCaretListener(final JFormattedTextField field) {
    mCaretListener = new CaretListener() {
      public void caretUpdate(final CaretEvent e) {
        if(mCaretPosition != -1 && field.getSelectedText() == null) {
          mCaretPosition = field.getCaretPosition();
        }
      }
View Full Code Here

    scroller.getViewport().add(editor);
    add(scroller, BorderLayout.CENTER);

    editor.getDocument().addDocumentListener(new CommandShellDocumentListener(this));

    editor.addCaretListener(new CaretListener() {
      public void caretUpdate(CaretEvent e) {
        int len = editor.getDocument().getLength();
        if (e.getDot() > len) {
          editor.setCaretPosition(len);
        }
View Full Code Here


    @Override
    public void setFormEvents(){
        dbg("test");
        jPassword.addCaretListener(new CaretListener() {

            public void caretUpdate(CaretEvent e) {
                reportAction(e);
                if(jPassword.getPassword().length>0){
                    btnConnect.setEnabled(true);
View Full Code Here

TOP

Related Classes of javax.swing.event.CaretListener

Copyright © 2018 www.massapicom. 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.