Package javax.swing.text

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


        final int pos = p + 3;
        if (pos >= 0 && pos < ip.length()) {
            application.invokeLater(new Runnable() {
                @Override
                public void run() {
                    tc.select(pos, ip.length());
                }
            });
        }
    }
View Full Code Here


          }
          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());
          jtpFindSource.requestFocus();
View Full Code Here

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

            JTextComponent editorComponent = (JTextComponent)comboBox.getEditor().getEditorComponent();
            // save unix system selection (middle mouse paste)
            Clipboard sysSel = Toolkit.getDefaultToolkit().getSystemSelection();
            if(sysSel != null) {
                Transferable old = sysSel.getContents(null);
                editorComponent.select(start, end);
                sysSel.setContents(old, null);
            } else {
                editorComponent.select(start, end);
            }
        }
View Full Code Here

            if(sysSel != null) {
                Transferable old = sysSel.getContents(null);
                editorComponent.select(start, end);
                sysSel.setContents(old, null);
            } else {
                editorComponent.select(start, end);
            }
        }

        private void setSelectedItem(Object item) {
            selecting = true;
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.