We've got a log pane showing log entries generated
from our application. As you can image
it gets very full.
Is there any way that we can clear the logs,
basically empty the pane?
We're using an instance of JTextPane added to a
JScrollPane.
Anybody, got any ideas?
Many thanks.
jay
textPane.setDocument(new PlainDocument());
should work
K.
Maybe I'm not reading your question correctly but setting the text its
displaying to empty will do what I think you need.
--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Christina Robertson - Research Engineer
Oasis Advanced Engineering, Inc.
Phone 248-373-9800 x 236
Fax 248-373-9898
myLogTextPane.setText("");
You could just call:
log.setText("");
See the discussion on the setText() method of JEditorPane.
--
Fred L. Kleinschmidt
Associate Technical Fellow
Boeing Common User Interface Services
Would I be better of deleting the pane and adding
a new instance?
jay
"Christina Robertson"
<robe...@OasisAdvancedEngineering.com> wrote in
message
news:3EC3A3F9...@OasisAdvancedEngineering.co
m...
Probably not.
Instead figure out why things aren't working for you.
first, toss a few calls to the pane's parent
invalidate();
revalidate();
That might do it.
Otherwise...
It could very easily be that you aren't holding the reference to the
instance you think you are.