Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-26-2008, 03:58 AM
Member
 
Join Date: Jun 2008
Posts: 1
nemesys571 is on a distinguished road
multiple class files
When the following class is compiled under Eclipse Europa, jre1.6.0_04, multiple .class files are created and the applet won't load on a webpage unless all of them are present. The class files created are:

TemplateDesigner.class
TemplateDesigner$1.class
TemplateDesigner$2.class
TemplateDesigner$3.class

What's the reason for this?

Code:
import javax.swing.JApplet; import javax.swing.JPanel; import javax.swing.SwingUtilities; //Since we're adding a Swing component, we now need to //extend JApplet. We need to be careful to access //components only on the event-dispatching thread. public class TemplateDesigner extends JApplet { JPanel mainPanel, extraPanel; public void init( ) { //Execute a job on the event-dispatching thread: //creating this applet's GUI. try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { createGUI(); } }); } catch (Exception e) { System.err.println("createGUI didn't successfully complete"); } addItem(false, "initializing... "); } private void createGUI() { mainPanel = new BasicTicketTemplate(); extraPanel = new JPanel(); setLayout(new java.awt.GridBagLayout()); add(mainPanel); } public void start() { addItem(false, "starting... "); } public void stop() { addItem(false, "stopping... "); } public void destroy() { addItem(false, "preparing for unloading..."); cleanUp(); } private void cleanUp() { //Execute a job on the event-dispatching thread: //taking the text field out of this applet. try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { remove(mainPanel); } }); } catch (Exception e) { System.err.println("cleanUp didn't successfully complete"); } mainPanel = extraPanel = null; } private void addItem(boolean alreadyInEDT, String newWord) { if (alreadyInEDT) { addItem(newWord); } else { final String word = newWord; //Execute a job on the event-dispatching thread: //invoking addItem(newWord). try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { addItem(word); } }); } catch (Exception e) { System.err.println("addItem didn't successfully complete"); } } } //Invoke this method ONLY from the event-dispatching thread. private void addItem(String newWord) { System.out.println(newWord); } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conversion of java .class files to .java files kotturupraveen New To Java 2 06-09-2008 02:58 PM
Opeing multiple pdf files in different acrobat reader windows shweta.ahuja Web Frameworks 2 05-07-2008 02:33 PM
Eclipse adding $1.class files eboraks Eclipse 1 11-28-2007 06:35 PM
how to see the code of class files mary Advanced Java 1 08-02-2007 03:52 PM
'class' and 'jar' files ai_2007 Advanced Java 1 06-29-2007 05:11 PM


All times are GMT +3. The time now is 01:43 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org