Forums Register Login

Determining whether object at current caret position is plain text or a component

+Pie Number of slices to send: Send
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.
}
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1135 times.
Similar Threads
how to get column position and row position from jtextarea
JTextPane
Displaying line # with JTextArea
Counting Lines
Find index by xy ??
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 03:36:50.