[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Patch: JEditorPane.setText
From: |
Mark Wielaard |
Subject: |
Re: [cp-patches] Patch: JEditorPane.setText |
Date: |
Sun, 11 Dec 2005 18:10:46 +0100 |
Hi Tony,
On Fri, 2005-12-09 at 14:31 -0500, Anthony Balkissoon wrote:
> + * @param t the text to display in this JEditorPane
> + */
> public void setText(String t)
> {
> - super.setText(t);
> + try
> + {
> + // Remove the current content.
> + Document doc = getDocument();
> + doc.remove(0, doc.getLength());
> + if (t == null || t == "")
> + return;
Please document the behavior when t == null.
Also you should compare Strings (even the empty String) with equals().
Cheers,
Mark
signature.asc
Description: This is a digitally signed message part