Search code examples
javaswinglistenerjtextpane

Change of state of a button when editing a JTextPane


I would to know how to apply a listener about a JtextPane, because I would to disable a button when the JTextPane is empty and activate a button when there are somethings in it. I've tried with an ItemChangeListener but it doesn't work.

Do you have any ideas please ?


Solution

  • Check DocumentListener, by the link there's a tutorial to help you solve your task.