Eclipse newbie can't execute Java library [message #778222] |
Wed, 11 January 2012 14:04  |
Eclipse User |
|
|
|
I'm a newbie to eclipse.
I want to implement JFontChooser in my project:
jfontchooser.sourceforge.jp/site/jfontchooser/screenshots.html
I downloaded the source. But when I import it in eclipse it had problems (like "package name did not match",etc.) I rectified them, by matching with the file structure. I referred to this forum post.
I got rid of all the errors but still when I run, it gives a error box saying Exception in thread "main" java.lang.SecurityException: Prohibited package name: java.say.swing Even after a google search I cant find the solution to the problem.
Can someone download and execute the source nad tell me the solution to this problem?
Info:I created a new package in eclipse with other names like: java.say.sting AND say.sting. But it gives me the same error or Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name say.sting.JFontChooserMessages, locale en_IN
Please execute it as I'm a newbie and I know these problems wont appear if you guyz do it on your own.
|
|
|
Re: Eclipse newbie can't execute Java library [message #778531 is a reply to message #778222] |
Fri, 13 January 2012 01:47  |
Eclipse User |
|
|
|
Except for actually working (I'm not sure what it's supposed to do. I can get the applet to load, though), it seems to compile and run fine. Take the source code from that page (everything EXCEPT the JFontChooserDemo section) and put it in a file called 'JFontChooser.java'. Make another file called 'JFontChooserDemo.java', and stick all the code for JFontChooserDemo in it. Next, create another file called 'JFontChooserTestRunner.java'. Copy and paste the code below into 'JFontChooserTestRunner.java'.
Other than commenting out the following two lines in JFontChooserDemo, you shouldn't have to change anything:
//package com.greef.ui.font;
//import com.greef.ui.UIUtilities;
Make sure all three files are in the same package. Run it as an applet. It should run.
import javax.swing.JApplet;
public class JFontChooserTestRunner extends JApplet {
/**
*
*/
private static final long serialVersionUID = 1L;
public void init() {
JFontChooserDemo demo = new JFontChooserDemo();
setContentPane(demo);
}
}
[Updated on: Fri, 13 January 2012 02:09] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03262 seconds