• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextPane and keyEvents  RSS feed

Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am making this app which is real similar to windows' chatting program ( i forgot the name ) where you talk to someone on the network and you have your textfield and they have theirs and every key you type is seen on their screen instantly in your textfield.
So i was wondering, since im sending KeyEvents over the network how i would apply these events to the document or JTextPane() which im using? I know i could just listen for keycodes and apply them to the client side, but it would be much easier if there was a method which dispatched these events.

I've looked into the KeyboardFocusManager and KeyEventDispatcher but i can't figure out how to use them correctly to make it do what I want it to do.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!