HTML Problem

C

Chris Nevill

Hi.
I'm developing a chat program currently it has a text box at the bottom
which when the enter key is pressed sets of an Action Listener,
so that the text can be sent....
All was well and good till I tried to add formatting options to it.
I want to be able to make part of the text bold etc, as the actual
message window is HTML based.
However if I turn the textentry box in to a JEditorPane I don't get
an AddActionListener method.
so i can't detect the enter key being pressed.
JTextField only seems to allow you to set formating options
on the whole box, and doesn't do it in HTML which would be favourable....
I tried taking the addActionListener method from JTextField and extending
JEditorPane... but as expected it didn't work..
Any Ideas?
Cheers
Chris
 
C

Chris Nevill

Is there anyway of counting the number of lines on a JEditorPane.
At first I thought I could count the number of </p>'s but that
didn't work because when you press enter in the editor pane
it doesn't add them until you press another letter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top