Why is it that JEditorPane cannot display some of the HTML controls other than text? How can I display buttons and other controls?
Created May 4, 2012
Sandip Chitale The JEditorPane is not a full blown implementation of HTML browser.
It does not support an HTTP forms interface. However you can add components like JButton to the JEditorPane using the following
method -
SimpleAttributeSet sas = new SimpleAttributeSet(); StyleConstants.setComponent(sas, new JButton("Hello")); editorPane.getDocument().insertString( editorPane.getDocument().getLength(), "", sas);