This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

trouble clearing JTextPane  RSS feed

 
Maksim Kogan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTextPane that needs to be cleared whenever a user hits the enter key. I'm using a nested "InputBoxProcessor" class in my applet and am using the keyPressed method as keyReleased and keyTyped both seem unresponsive. the method clears all the text and sends it to its proper destination, however I still have a trailing newline which stays in the JTextPane. I've tried reading the API docs on how to solve this and still nothing. Below is my code for the method, please help, this is pretty much the last wrinkle I need to iron out.

[ April 02, 2004: Message edited by: Maksim Kogan ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!