Examples of moveCaretPosition()


Examples of javax.swing.JTextArea.moveCaretPosition()

            }
        }

        // test moveCaretPosition
        area.setSelectionStart(5);
        area.moveCaretPosition(0);
        harness.check(area.getSelectedText(), "abcde", "moveCaretPositio()");
  }
}
View Full Code Here

Examples of javax.swing.JTextPane.moveCaretPosition()

    }
    textPane.setParagraphAttributes(style, true);

    // Restore selection
    textPane.setCaretPosition(selStart);
    textPane.moveCaretPosition(selEnd);

    makeBorders();
}

/**
 
View Full Code Here

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

                    String tillComplete = input.substring(pos + 1);
                    tillComplete = sorted[0].substring(tillComplete.length());
                    comp.setText(input + tillComplete);
                    comp.setCaretPosition(comp.getText().length());
                    if (tillComplete.length() > 0) {
                        comp.moveCaretPosition(caretPos);
                    } else {
                        comp.setCaretPosition(comp.getText().length());
                    }
                    comboModel.update();
                }
View Full Code Here

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

    }
    Pattern pattern = Pattern.compile(textPattern);
    Matcher matcher = pattern.matcher(text.getText());
    if (matcher.find(text.getCaretPosition())) {
      text.setCaretPosition(matcher.start());
      text.moveCaretPosition(matcher.end());
      text.requestFocus();
      return;
    }
    if (matcher.find(0)) {
      text.setCaretPosition(matcher.start());
View Full Code Here

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

      text.requestFocus();
      return;
    }
    if (matcher.find(0)) {
      text.setCaretPosition(matcher.start());
      text.moveCaretPosition(matcher.end());
      text.requestFocus();
      return;
    }
  }
View Full Code Here

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

                        endOffs = Utilities.getWordEnd(target, endOffs);
                    } else {
                        endOffs = Utilities.getWordEnd(target, offs);
                    }

                    target.moveCaretPosition(endOffs);

                    // and then delete it
                    target.replaceSelection("");
                    beep = false;
                } catch (BadLocationException exc) {
View Full Code Here

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

                        failed = true;
                    }
                }

                if (!failed) {
                    target.moveCaretPosition(offs);

                    // and then delete it
                    target.replaceSelection("");
                    beep = false;
                }
View Full Code Here

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

        public void actionPerformed(ActionEvent e) {
            JTextComponent target = getTextComponent(e);
            if (target != null) {
                Document doc = target.getDocument();
                target.setCaretPosition(0);
                target.moveCaretPosition(doc.getLength());
            }
        }
    }
   
    /**
 
View Full Code Here

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

        public void actionPerformed(ActionEvent e) {
            JTextComponent target = getTextComponent(e);
            if (target != null) {
                Document doc = target.getDocument();
                target.setCaretPosition(0);
                target.moveCaretPosition(doc.getLength());
            }
        }
    }
   
    /**
 
View Full Code Here

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

        public void actionPerformed(ActionEvent e) {
            JTextComponent target = getTextComponent(e);
            if (target != null) {
                Document doc = target.getDocument();
                target.setCaretPosition(0);
                target.moveCaretPosition(doc.getLength());
            }
        }
    }
   
    /**
 
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.