Skip to main content



      Home
Home » Newcomers » Newcomers » getFontRegistry problem
getFontRegistry problem [message #199999] Sat, 17 March 2007 03:07 Go to next message
Eclipse UserFriend
Originally posted by: waynel.mannywhere.com

HI!!

I am trying to use the the Jface Fontregistry and no matter what I do I
keeping get the same failure.

To make sure it isn't my code I went to
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTFontReg istryExample.htm
and got their example and it fails in the same place as my code.
=============================

import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;


public class FontRegistryExample {


Display display = new Display();
Shell shell = new Shell(display);

FontRegistry fontRegistry;

public FontRegistryExample() {
init();

shell.pack();
shell.open();
//textUser.forceFocus();

// Set up the event loop.
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
// If no more entries in event queue
display.sleep();
}
}

display.dispose();
}

private void init() {
shell.setLayout(new GridLayout(2, false));

fontRegistry = new FontRegistry(display);

fontRegistry.put("button-text", new FontData[]{new FontData("Arial",
9, SWT.BOLD)} );
fontRegistry.put("code", new FontData[]{new FontData("Courier New",
10, SWT.NORMAL)});

Text text = new Text(shell, SWT.MULTI | SWT.BORDER | SWT.WRAP);
text.setFont(fontRegistry.get("code"));
text.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
text.setText("public static void main()
{\n\tSystem.out.println(\"Hello\"); \n}");
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 2;
text.setLayoutData(gd);

Button executeButton = new Button(shell, SWT.PUSH);
executeButton.setText("Execute");
executeButton.setFont(fontRegistry.get("button-text"));

Button cancelButton = new Button(shell, SWT.PUSH);
cancelButton.setText("Cancel");
cancelButton.setFont(fontRegistry.get("button-text"));


}

public static void main(String[] args) {
new FontRegistryExample();
}
}
=========================================================

The code always fails at

fontRegistry = new FontRegistry(display);

with this error

=========================================================

Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/core/commands/common/EventManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at FontRegistryExample.init(FontRegistryExample.java:41)
at FontRegistryExample.<init>(FontRegistryExample.java:21)
============================================================ ==============

I would apprieciate any help its beginning to get on my nerves.
Re: getFontRegistry problem [message #200038 is a reply to message #199999] Sat, 17 March 2007 08:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Wayne,

Are you running standalone or as an Eclipse/OSGi application? If
standalone, do you have the jar containing EventManager on the
classpath? If OSGi, do you have the right plugin dependencies set in
your plugins MANIFEST.MF?


Wayne LaRochelle wrote:
> HI!!
>
> I am trying to use the the Jface Fontregistry and no matter what I do
> I keeping get the same failure.
> To make sure it isn't my code I went to
> http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTFontReg istryExample.htm
>
> and got their example and it fails in the same place as my code.
> =============================
>
> import org.eclipse.jface.resource.FontRegistry;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.graphics.FontData;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Text;
>
>
> public class FontRegistryExample {
>
>
> Display display = new Display();
> Shell shell = new Shell(display);
> FontRegistry fontRegistry;
>
> public FontRegistryExample() {
> init();
>
> shell.pack();
> shell.open();
> //textUser.forceFocus();
>
> // Set up the event loop.
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch()) {
> // If no more entries in event queue
> display.sleep();
> }
> }
>
> display.dispose();
> }
>
> private void init() {
> shell.setLayout(new GridLayout(2, false));
> fontRegistry = new FontRegistry(display);
> fontRegistry.put("button-text", new FontData[]{new
> FontData("Arial", 9, SWT.BOLD)} );
> fontRegistry.put("code", new FontData[]{new FontData("Courier
> New", 10, SWT.NORMAL)});
> Text text = new Text(shell, SWT.MULTI | SWT.BORDER |
> SWT.WRAP);
> text.setFont(fontRegistry.get("code"));
> text.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
> text.setText("public static void main()
> {\n\tSystem.out.println(\"Hello\"); \n}");
> GridData gd = new GridData(GridData.FILL_BOTH);
> gd.horizontalSpan = 2;
> text.setLayoutData(gd);
> Button executeButton = new Button(shell, SWT.PUSH);
> executeButton.setText("Execute");
> executeButton.setFont(fontRegistry.get("button-text"));
> Button cancelButton = new Button(shell, SWT.PUSH);
> cancelButton.setText("Cancel");
> cancelButton.setFont(fontRegistry.get("button-text"));
> }
>
> public static void main(String[] args) {
> new FontRegistryExample();
> }
> }
> =========================================================
>
> The code always fails at
> fontRegistry = new FontRegistry(display);
>
> with this error
>
> =========================================================
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/eclipse/core/commands/common/EventManager
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at java.security.SecureClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.access$100(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at java.security.SecureClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.access$100(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> at FontRegistryExample.init(FontRegistryExample.java:41)
> at FontRegistryExample.<init>(FontRegistryExample.java:21)
> ============================================================ ==============
>
>
> I would apprieciate any help its beginning to get on my nerves.
>
>
>
>
>
>
Re: getFontRegistry problem [message #200062 is a reply to message #200038] Sat, 17 March 2007 11:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.domain.invalid

HI!! ED

Thanks for responding. I am converting a number of museum exhibits from
OpenGL to java so we can put them on the Internet.

I am using Eclipse3.2.2 and am currently testing from within Eclipse,
the plan is to eventually turn the code into an application.

1: which jar contains the EventManager
2: for a standalone application the references all say I need jface.jar
but I can't find it anywhere.

Thanks

WAYNEL






Ed Merks wrote:
> Wayne,
>
> Are you running standalone or as an Eclipse/OSGi application? If
> standalone, do you have the jar containing EventManager on the
> classpath? If OSGi, do you have the right plugin dependencies set in
> your plugins MANIFEST.MF?
>
>
> Wayne LaRochelle wrote:
>> HI!!
>>
>> I am trying to use the the Jface Fontregistry and no matter what I do
>> I keeping get the same failure.
>> To make sure it isn't my code I went to
>> http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTFontReg istryExample.htm
>>
>> and got their example and it fails in the same place as my code.
>> =============================
>>
>> import org.eclipse.jface.resource.FontRegistry;
>> import org.eclipse.swt.SWT;
>> import org.eclipse.swt.graphics.FontData;
>> import org.eclipse.swt.layout.GridData;
>> import org.eclipse.swt.layout.GridLayout;
>> import org.eclipse.swt.widgets.Button;
>> import org.eclipse.swt.widgets.Display;
>> import org.eclipse.swt.widgets.Shell;
>> import org.eclipse.swt.widgets.Text;
>>
>>
>> public class FontRegistryExample {
>>
>> Display display = new Display();
>> Shell shell = new Shell(display);
>> FontRegistry fontRegistry;
>>
>> public FontRegistryExample() {
>> init();
>>
>> shell.pack();
>> shell.open();
>> //textUser.forceFocus();
>>
>> // Set up the event loop.
>> while (!shell.isDisposed()) {
>> if (!display.readAndDispatch()) {
>> // If no more entries in event queue
>> display.sleep();
>> }
>> }
>>
>> display.dispose();
>> }
>>
>> private void init() {
>> shell.setLayout(new GridLayout(2, false));
>> fontRegistry = new FontRegistry(display);
>> fontRegistry.put("button-text", new FontData[]{new
>> FontData("Arial", 9, SWT.BOLD)} );
>> fontRegistry.put("code", new FontData[]{new FontData("Courier
>> New", 10, SWT.NORMAL)});
>> Text text = new Text(shell, SWT.MULTI | SWT.BORDER |
>> SWT.WRAP);
>> text.setFont(fontRegistry.get("code"));
>> text.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
>> text.setText("public static void main()
>> {\n\tSystem.out.println(\"Hello\"); \n}");
>> GridData gd = new GridData(GridData.FILL_BOTH);
>> gd.horizontalSpan = 2;
>> text.setLayoutData(gd);
>> Button executeButton = new Button(shell, SWT.PUSH);
>> executeButton.setText("Execute");
>> executeButton.setFont(fontRegistry.get("button-text"));
>> Button cancelButton = new Button(shell, SWT.PUSH);
>> cancelButton.setText("Cancel");
>> cancelButton.setFont(fontRegistry.get("button-text"));
>> }
>>
>> public static void main(String[] args) {
>> new FontRegistryExample();
>> }
>> }
>> =========================================================
>>
>> The code always fails at
>> fontRegistry = new FontRegistry(display);
>>
>> with this error
>>
>> =========================================================
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/eclipse/core/commands/common/EventManager
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(Unknown Source)
>> at java.security.SecureClassLoader.defineClass(Unknown Source)
>> at java.net.URLClassLoader.defineClass(Unknown Source)
>> at java.net.URLClassLoader.access$100(Unknown Source)
>> at java.net.URLClassLoader$1.run(Unknown Source)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(Unknown Source)
>> at java.security.SecureClassLoader.defineClass(Unknown Source)
>> at java.net.URLClassLoader.defineClass(Unknown Source)
>> at java.net.URLClassLoader.access$100(Unknown Source)
>> at java.net.URLClassLoader$1.run(Unknown Source)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>> at FontRegistryExample.init(FontRegistryExample.java:41)
>> at FontRegistryExample.<init>(FontRegistryExample.java:21)
>> ============================================================ ==============
>>
>>
>> I would apprieciate any help its beginning to get on my nerves.
>>
>>
>>
>>
>>
>>
Re: getFontRegistry problem [message #200085 is a reply to message #200062] Sat, 17 March 2007 12:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Wayne,

EventManager is in org.eclipse.core.commands*.jar. You should find
org.eclipse.jface*.jar in the plugins folder of your eclipse installation.


user@domain.invalid wrote:
> HI!! ED
>
> Thanks for responding. I am converting a number of museum exhibits
> from OpenGL to java so we can put them on the Internet.
>
> I am using Eclipse3.2.2 and am currently testing from within Eclipse,
> the plan is to eventually turn the code into an application.
>
> 1: which jar contains the EventManager
> 2: for a standalone application the references all say I need
> jface.jar but I can't find it anywhere.
>
> Thanks
>
> WAYNEL
>
>
>
>
>
>
> Ed Merks wrote:
>> Wayne,
>>
>> Are you running standalone or as an Eclipse/OSGi application? If
>> standalone, do you have the jar containing EventManager on the
>> classpath? If OSGi, do you have the right plugin dependencies set in
>> your plugins MANIFEST.MF?
>>
>>
>> Wayne LaRochelle wrote:
>>> HI!!
>>>
>>> I am trying to use the the Jface Fontregistry and no matter what I
>>> do I keeping get the same failure.
>>> To make sure it isn't my code I went to
>>> http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTFontReg istryExample.htm
>>>
>>> and got their example and it fails in the same place as my code.
>>> =============================
>>>
>>> import org.eclipse.jface.resource.FontRegistry;
>>> import org.eclipse.swt.SWT;
>>> import org.eclipse.swt.graphics.FontData;
>>> import org.eclipse.swt.layout.GridData;
>>> import org.eclipse.swt.layout.GridLayout;
>>> import org.eclipse.swt.widgets.Button;
>>> import org.eclipse.swt.widgets.Display;
>>> import org.eclipse.swt.widgets.Shell;
>>> import org.eclipse.swt.widgets.Text;
>>>
>>>
>>> public class FontRegistryExample {
>>> Display display = new Display();
>>> Shell shell = new Shell(display);
>>> FontRegistry fontRegistry;
>>>
>>> public FontRegistryExample() {
>>> init();
>>>
>>> shell.pack();
>>> shell.open();
>>> //textUser.forceFocus();
>>>
>>> // Set up the event loop.
>>> while (!shell.isDisposed()) {
>>> if (!display.readAndDispatch()) {
>>> // If no more entries in event queue
>>> display.sleep();
>>> }
>>> }
>>>
>>> display.dispose();
>>> }
>>>
>>> private void init() {
>>> shell.setLayout(new GridLayout(2, false));
>>> fontRegistry = new FontRegistry(display);
>>> fontRegistry.put("button-text", new FontData[]{new
>>> FontData("Arial", 9, SWT.BOLD)} );
>>> fontRegistry.put("code", new FontData[]{new
>>> FontData("Courier New", 10, SWT.NORMAL)});
>>> Text text = new Text(shell, SWT.MULTI | SWT.BORDER |
>>> SWT.WRAP);
>>> text.setFont(fontRegistry.get("code"));
>>> text.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
>>> text.setText("public static void main()
>>> {\n\tSystem.out.println(\"Hello\"); \n}");
>>> GridData gd = new GridData(GridData.FILL_BOTH);
>>> gd.horizontalSpan = 2;
>>> text.setLayoutData(gd);
>>> Button executeButton = new Button(shell, SWT.PUSH);
>>> executeButton.setText("Execute");
>>> executeButton.setFont(fontRegistry.get("button-text"));
>>> Button cancelButton = new Button(shell, SWT.PUSH);
>>> cancelButton.setText("Cancel");
>>> cancelButton.setFont(fontRegistry.get("button-text"));
>>> }
>>>
>>> public static void main(String[] args) {
>>> new FontRegistryExample();
>>> }
>>> }
>>> =========================================================
>>>
>>> The code always fails at
>>> fontRegistry = new FontRegistry(display);
>>>
>>> with this error
>>>
>>> =========================================================
>>>
>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>> org/eclipse/core/commands/common/EventManager
>>> at java.lang.ClassLoader.defineClass1(Native Method)
>>> at java.lang.ClassLoader.defineClass(Unknown Source)
>>> at java.security.SecureClassLoader.defineClass(Unknown Source)
>>> at java.net.URLClassLoader.defineClass(Unknown Source)
>>> at java.net.URLClassLoader.access$100(Unknown Source)
>>> at java.net.URLClassLoader$1.run(Unknown Source)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.net.URLClassLoader.findClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>> at java.lang.ClassLoader.defineClass1(Native Method)
>>> at java.lang.ClassLoader.defineClass(Unknown Source)
>>> at java.security.SecureClassLoader.defineClass(Unknown Source)
>>> at java.net.URLClassLoader.defineClass(Unknown Source)
>>> at java.net.URLClassLoader.access$100(Unknown Source)
>>> at java.net.URLClassLoader$1.run(Unknown Source)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.net.URLClassLoader.findClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>> at FontRegistryExample.init(FontRegistryExample.java:41)
>>> at FontRegistryExample.<init>(FontRegistryExample.java:21)
>>> ============================================================ ==============
>>>
>>>
>>> I would apprieciate any help its beginning to get on my nerves.
>>>
>>>
>>>
>>>
>>>
>>>
Re: getFontRegistry problem [message #200100 is a reply to message #200085] Sat, 17 March 2007 13:23 Go to previous message
Eclipse UserFriend
Originally posted by: waynel.mannywhere.com

HI!!

that was it.

Thank you very much

WAYNEL




Ed Merks wrote:
> Wayne,
>
> EventManager is in org.eclipse.core.commands*.jar. You should find
> org.eclipse.jface*.jar in the plugins folder of your eclipse installation.
>
>
> user@domain.invalid wrote:
>> HI!! ED
>>
>> Thanks for responding. I am converting a number of museum exhibits
>> from OpenGL to java so we can put them on the Internet.
>>
>> I am using Eclipse3.2.2 and am currently testing from within Eclipse,
>> the plan is to eventually turn the code into an application.
>>
>> 1: which jar contains the EventManager
>> 2: for a standalone application the references all say I need
>> jface.jar but I can't find it anywhere.
>>
>> Thanks
>>
>> WAYNEL
>>
>>
>>
>>
>>
>>
>> Ed Merks wrote:
>>> Wayne,
>>>
>>> Are you running standalone or as an Eclipse/OSGi application? If
>>> standalone, do you have the jar containing EventManager on the
>>> classpath? If OSGi, do you have the right plugin dependencies set in
>>> your plugins MANIFEST.MF?
>>>
>>>
>>> Wayne LaRochelle wrote:
>>>> HI!!
>>>>
>>>> I am trying to use the the Jface Fontregistry and no matter what I
>>>> do I keeping get the same failure.
>>>> To make sure it isn't my code I went to
>>>> http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTFontReg istryExample.htm
>>>>
>>>> and got their example and it fails in the same place as my code.
>>>> =============================
>>>>
>>>> import org.eclipse.jface.resource.FontRegistry;
>>>> import org.eclipse.swt.SWT;
>>>> import org.eclipse.swt.graphics.FontData;
>>>> import org.eclipse.swt.layout.GridData;
>>>> import org.eclipse.swt.layout.GridLayout;
>>>> import org.eclipse.swt.widgets.Button;
>>>> import org.eclipse.swt.widgets.Display;
>>>> import org.eclipse.swt.widgets.Shell;
>>>> import org.eclipse.swt.widgets.Text;
>>>>
>>>>
>>>> public class FontRegistryExample {
>>>> Display display = new Display();
>>>> Shell shell = new Shell(display);
>>>> FontRegistry fontRegistry;
>>>>
>>>> public FontRegistryExample() {
>>>> init();
>>>>
>>>> shell.pack();
>>>> shell.open();
>>>> //textUser.forceFocus();
>>>>
>>>> // Set up the event loop.
>>>> while (!shell.isDisposed()) {
>>>> if (!display.readAndDispatch()) {
>>>> // If no more entries in event queue
>>>> display.sleep();
>>>> }
>>>> }
>>>>
>>>> display.dispose();
>>>> }
>>>>
>>>> private void init() {
>>>> shell.setLayout(new GridLayout(2, false));
>>>> fontRegistry = new FontRegistry(display);
>>>> fontRegistry.put("button-text", new FontData[]{new
>>>> FontData("Arial", 9, SWT.BOLD)} );
>>>> fontRegistry.put("code", new FontData[]{new
>>>> FontData("Courier New", 10, SWT.NORMAL)});
>>>> Text text = new Text(shell, SWT.MULTI | SWT.BORDER |
>>>> SWT.WRAP);
>>>> text.setFont(fontRegistry.get("code"));
>>>> text.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
>>>> text.setText("public static void main()
>>>> {\n\tSystem.out.println(\"Hello\"); \n}");
>>>> GridData gd = new GridData(GridData.FILL_BOTH);
>>>> gd.horizontalSpan = 2;
>>>> text.setLayoutData(gd);
>>>> Button executeButton = new Button(shell, SWT.PUSH);
>>>> executeButton.setText("Execute");
>>>> executeButton.setFont(fontRegistry.get("button-text"));
>>>> Button cancelButton = new Button(shell, SWT.PUSH);
>>>> cancelButton.setText("Cancel");
>>>> cancelButton.setFont(fontRegistry.get("button-text"));
>>>> }
>>>>
>>>> public static void main(String[] args) {
>>>> new FontRegistryExample();
>>>> }
>>>> }
>>>> =========================================================
>>>>
>>>> The code always fails at
>>>> fontRegistry = new FontRegistry(display);
>>>>
>>>> with this error
>>>>
>>>> =========================================================
>>>>
>>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>>> org/eclipse/core/commands/common/EventManager
>>>> at java.lang.ClassLoader.defineClass1(Native Method)
>>>> at java.lang.ClassLoader.defineClass(Unknown Source)
>>>> at java.security.SecureClassLoader.defineClass(Unknown Source)
>>>> at java.net.URLClassLoader.defineClass(Unknown Source)
>>>> at java.net.URLClassLoader.access$100(Unknown Source)
>>>> at java.net.URLClassLoader$1.run(Unknown Source)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at java.net.URLClassLoader.findClass(Unknown Source)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>>> at java.lang.ClassLoader.defineClass1(Native Method)
>>>> at java.lang.ClassLoader.defineClass(Unknown Source)
>>>> at java.security.SecureClassLoader.defineClass(Unknown Source)
>>>> at java.net.URLClassLoader.defineClass(Unknown Source)
>>>> at java.net.URLClassLoader.access$100(Unknown Source)
>>>> at java.net.URLClassLoader$1.run(Unknown Source)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at java.net.URLClassLoader.findClass(Unknown Source)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>>> at FontRegistryExample.init(FontRegistryExample.java:41)
>>>> at FontRegistryExample.<init>(FontRegistryExample.java:21)
>>>> ============================================================ ==============
>>>>
>>>>
>>>> I would apprieciate any help its beginning to get on my nerves.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
Previous Topic:swt not found
Next Topic:Build numbers
Goto Forum:
  


Current Time: Tue Jul 22 02:34:49 EDT 2025

Powered by FUDForum. Page generated in 0.06830 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top