Determining whether object at current caret position is plain text or a component
Richard Robbins
Ranch Hand
Joined: Mar 07, 2001
Posts: 66
posted
0
How does one determine whether there is regular text or a component at the current caret position in a JTextPane? For instance.. JTextPane textInput = new JTextPane(); . . for(int i = 0; i < textInput.getText().length(); i++){ textInput.setCaretPosition(i); //check to see whether the current caret position contains //regular text (content) or if it contains a component. }