[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Telling JEditorPane that its test is HTML



Thanks Jim,

Did the trick!

Chris

On Tue, 2002-11-19 at 17:04, Jim Worthington wrote:
> It looks like you need to call JEditorPane.setContentType("text/html")
> 
> - Jim
> 
> 
> -----Original Message-----
> From: cfowler [mailto:cfowler@outpostsentinel.com]
> Sent: Tuesday, November 19, 2002 2:23 PM
> To: ajug-members@ajug.org
> Subject: Telling JEditorPane that its test is HTML
> 
> 
> I'm creating some help in a JEditorPane in HTML format.
> 
> 
> 
>   private void populateHelp() {
>     help.append("Content-Type: text/html\n\n");
>     help.append("<HTML><HEAD></HEAD><BODY>\n");
>     help.append("<H1>Console Connection Help</H1>\n");
>     help.append("<HR>\n");
>     help.append("</BODY></HTML>\n");
> 
>     // Add it in
>     jEditorPane1.setEditable(true);
>     jEditorPane1.setText(help.toString());
> 
>   }
> 
> 
> When I display I see the real HTML code an not a rendered look.  All the
> code I've seen is populating from URL.  How can I tell the jEditorPane1
> that this String class in setText() is pure HTML?
> 
> Thanks,
> Chris
> 
> 
> 
> 
>