¡@

Home 

java Programming Glossary: setcaretposition

How to change highlighting color in Java Swing TextArea? And also, change the beginning of text corresponding to the highlighting location

http://stackoverflow.com/questions/10306901/how-to-change-highlighting-color-in-java-swing-textarea-and-also-change-the-be

index of my substring which I want to highlight. I use setCaretPosition pos to update the showing content. But it always appears at.. Color.yellow textArea.setCaretPosition pos2 The result is I want it to be at the right top of the screen.. highlights.get startIndex tarea.setCaretPosition startIndex tarea.requestFocusInWindow highlights.remove startIndex..

Is there any way to accept only numeric values in a JTextField?

http://stackoverflow.com/questions/1313390/is-there-any-way-to-accept-only-numeric-values-in-a-jtextfield

old_caret_position getCaretPosition super.setValue value setCaretPosition Math.min old_caret_position getText .length @Override protected..

Swing component flickering when updated a lot

http://stackoverflow.com/questions/669979/swing-component-flickering-when-updated-a-lot

while true b.append i NL a.setText b.toString a.setCaretPosition b.length try Thread.sleep 10 catch Exception e .start .. safe unless they are explicitly declared as such. Thus setCaretPosition is not Thread safe and must be accessed from the event thread... inherits its setText method from JEditorPane and its setCaretPosition method from JTextComponent which explains the links in the previous..

Limited selection in a JTextField/JTextComponent?

http://stackoverflow.com/questions/7421337/limited-selection-in-a-jtextfield-jtextcomponent

accomplish this with a CaretListener or by overriding setCaretPosition moveCaretPosition which prevents a C a from selecting the entire.. .put delete previous new BackspaceAction component.setCaretPosition prefixLength public void setDot NavigationFilter.FilterBypass..