This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Richard Robbins
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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++){
//check to see whether the current caret position contains
//regular text (content) or if it contains a component.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!