• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SWT Browser, How to change a font size

Phuwarin Supawarapopng
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I create a dialog for display the html table tag string, on a window application. No problem I can display it. But the problen is that a font is quite big, bigger than what it display on the IE or FF or GC browser.

Browser browser = new Browser(dialog, SWT.RESIZE);
browser.setText(<html><table><tr><td nowrap>This is some text</td></tr></table></html>);
browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

I try to change a font size with below code, but it is not take effect.

Font font = new Font (dialog.getDisplay(), "Tahoma", 1, SWT.NONE);

Can anhyone help how to change a smaller font size?
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic