Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 3101 Details for
Bug 29290
[Widgets] NumberFormatException getting FontMetrics on Solaris
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Andrew Hobsons font test file
FontTest.java (text/plain), 2.41 KB, created by
Tod Creasey
on 2003-01-23 10:19:36 EST
(
hide
)
Description:
Andrew Hobsons font test file
Filename:
MIME Type:
Creator:
Tod Creasey
Created:
2003-01-23 10:19:36 EST
Size:
2.41 KB
patch
obsolete
>package test; >import org.eclipse.swt.*; >import org.eclipse.swt.custom.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.widgets.*; >import org.eclipse.swt.layout.*; > >import org.eclipse.jface.resource.JFaceResources; > >public class FontTest { > public void test() { > try { > // create the widget's shell > Shell shell = new Shell(); > shell.setLayout(new FillLayout()); > shell.setSize(200, 100); > Display display = shell.getDisplay(); > // create the styled text widget > StyledText widget = new StyledText(shell, SWT.BORDER); > widget.setText("This is the StyledText widget."); > > GC gc = new GC(shell); > Font f= JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); > System.out.println("f:" + f); > gc.setFont(f); > FontMetrics fm = gc.getFontMetrics(); > System.out.println("fm:" + fm + ":height:" + fm.getHeight()); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > } catch (Exception e) { > e.printStackTrace(); > } > } > public static void main(String args[]) { > FontTest fontTest = new FontTest(); > fontTest.test(); > } >} >Content-Type: text/plain > >package test; >import org.eclipse.swt.*; >import org.eclipse.swt.custom.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.widgets.*; >import org.eclipse.swt.layout.*; > >import org.eclipse.jface.resource.JFaceResources; > >public class FontTest { > public void test() { > try { > // create the widget's shell > Shell shell = new Shell(); > shell.setLayout(new FillLayout()); > shell.setSize(200, 100); > Display display = shell.getDisplay(); > // create the styled text widget > StyledText widget = new StyledText(shell, SWT.BORDER); > widget.setText("This is the StyledText widget."); > > GC gc = new GC(shell); > Font f= JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); > System.out.println("f:" + f); > gc.setFont(f); > FontMetrics fm = gc.getFontMetrics(); > System.out.println("fm:" + fm + ":height:" + fm.getHeight()); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > } catch (Exception e) { > e.printStackTrace(); > } > } > public static void main(String args[]) { > FontTest fontTest = new FontTest(); > fontTest.test(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 29290
: 3101 |
3105
|
3106