java - Display HTML text in SWT Label -


i display html text in java swt label. below code creating label.

label thelabel = new label(controls,swt.wrap); thelabel.setsize(100,500); thelable.settext("<html><ol><li>hello</li><li>welcome</li></ol></html>"); 

when run application eclipse application output as:

<html><ol><li>hello</li><li>welcome</li></ol></html> 

what mistake? why not getting html formatted output in label? using eclipse plugin view.

to show html swt have use browser widget instead.

browser browser = new browser( parent, swt.none ); browser.settext( "<html><ol><li>hello</li><li>welcome</li></ol></html>" ); 

if don't mind dependency on org.eclipse.ui.forms can use formtext. aware control understand subset of html (<p>, <b>, <li>, <img>, <br>, <span>) render simple formatted text.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -