Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse newbie can't execute Java library(Executing JFontChooser library gives Prohibited package name: java.say.swing )
Eclipse newbie can't execute Java library [message #778222] Wed, 11 January 2012 19:04 Go to next message
Jaison Varghese is currently offline Jaison VargheseFriend
Messages: 1
Registered: January 2012
Junior Member
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 06:47 Go to previous message
Tim Bennett is currently offline Tim BennettFriend
Messages: 10
Registered: January 2012
Junior Member
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 07:09]

Report message to a moderator

Previous Topic:ANT Run
Next Topic:Using Internal ASTNode(not DOM's) 's "bits" field...
Goto Forum:
  


Current Time: Fri Apr 26 23:52:18 GMT 2024

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

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

Back to the top