|
Re: Eclipse newbie can't execute Java library [message #778531 is a reply to message #778222] |
Fri, 13 January 2012 06:47 |
Tim Bennett 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
|
|
|
Powered by
FUDForum. Page generated in 0.03490 seconds