Chris Simpkins

Greenhorn
+ Follow
since Sep 23, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Chris Simpkins

Thanks for your reply Michael. It worked!

Thanks again,
-Chris
[ September 28, 2005: Message edited by: Chris Simpkins ]
19 years ago
I like the Substance l&f. It's released under a BSD license. You can find it here:

https://substance.dev.java.net/

-Chris
19 years ago
I am designing an application that has an undecorated frame as its main frame and I need for a number of tasks to be completed prior to exiting the application. These methods are included in an inner class that is added as an actionListener on an exit button that i've added to the image. The problem is that these exits methods are all skipped if the user uses the Windows taskbar right click menu to close the application. Is it possible to add my action handler to this or can I disable this right click menu in the taskbar?

Thanks,
Chris
19 years ago
I'd like to reclaim the resources from a splash screen that is programmatically opened and closed in the constructor of the main frame while the components are instantiated for the main frame. Is it appropriate to call .dispose() on the splash frame after the .setVisible(false) method in order to reclaim the resources from this frame or does it lose scope once the constructor is completed allowing the memory to be reclaimed?

Also, how can you prevent a splash screen frame from showing up in the Windows taskbar?

Thanks!
-Chris
19 years ago
I figured out what was causing the problem. One of the JAR files (substance look and feel) that my application used was being included in the main directory of my application's JAR without the path structure that was being used for the import. I downloaded the substance L&F JAR as compiled files and placed the JAR on the buildpath for my own classes. Interestingly, this worked when run from within Eclipse, but obviously, previously compiled files are not re-compiled and the substance L&F JAR was inaccessible in the location where it was placed in my JAR.

My solution was to download the source files and include them in a separate project in my workspace. I then listed this as one of the dependent projects on my buildpath and voila... it worked. Proper file structure and a JAR of Pong!

Thanks to all who helped. If anyone runs into a similar problem and needs any help, feel free to e-mail. The Eclipse IDE makes jar file creation relatively easy, but you have to play around with your settings a bit.

By the way, the FatJar plugin for Eclipse appears to be another option. I didn't use it because this worked but you can get more information here: http://fjep.sourceforge.net/

-Chris
19 years ago
Thank you very much for pointing out the FatJar plugin Barry. I'll definitely check it out.

I'm still interested in learning more about these classpath, jar packaging issues. I've read a number of resources both on the web and in print and in my experience this information hasn't been very well documented. Perhaps I haven't looked in the right places I'll post a message to let you know how the FatJar plugin worked.

Layne, do you mean something like this?


My eclipse workspace is where I have all of the JAR's and this is the path to that directory. Can you list multiple directories if the imported packages are in different locations or do they all have to be in the same directory?

Thanks for all of your feedback. This has been extremely helpful.

-Chris

[ September 25, 2005: Message edited by: Chris Simpkins ]

[ September 25, 2005: Message edited by: Chris Simpkins ]
[ September 25, 2005: Message edited by: Chris Simpkins ]
19 years ago
Thanks again for your help Norm. Here is all of the information that you requested:

Manifest file (includes a return after the final line):


The main class (StartPong):


The console output when I try to run the JAR file from the command line:



It appears that despite importing the appropriate l&f package which is on my classpath and recognized by the IDE, the classes are not being packed into the JAR. This gets back to my second question from my post above regarding the remainder of open source packages that I am using in this project. Eclipse recognized all of the imports after I added them to the classpath, but I think that I am going to have the same problem with other package imports as well because when I search through the classes in the JAR file, the only classes that are there are the ones that are included in my package (org.pongpong.pong).

Any thoughts?

Thanks again,
-Chris
[ September 25, 2005: Message edited by: Chris Simpkins ]
19 years ago
Another option is the Apache Jakarta HttpClient. This page shows you how to instantiate a new httpclient, create the GET method, execute the method, and catch the exceptions that are thrown:

HttpClient Tutorial

Hope that this helps.

-Chris
Sorry didn't answer your question about the Main class entry on the manifest file. It does have a correct path to the main class.
-CS
19 years ago
Thanks for your message. So, I took your advice and examined the directory structure in the JAR file with WinZIP. When it is packaged as a JAR, there are three main directories in the JAR file. One is called .settings and contains resources, ui, and core prefs classes that come from eclipse packages. Another folder is called META-INF and contains the manifest file which has been named MANIFEST.MF. The final one is an appropriate directory tree of my classes:

org/pongpong/pong

This directory contains all of the classes that I've coded, including the class that contains my method which is named StartPong.class.

Does the manifest file need to come out of this separate directory so that the virtual machine can determine the appropriate directory path to find the classes?

Also, in looking at this, another question has come up. I've used a number of classes from open source code that were in separate packages in my workspace in the Eclipse IDE. None of the classes from these packages are contained within my JAR. For instance, I am using the httpclient class from apache which is in the package: org.apache.commons.httpclient. This is on my classpath in the IDE and compiles and runs without any problems when I run it from within the IDE; however, will there be problems without these classes in the JAR file at runtime or are the references to the classes compiled into my class files? If the former is true, can you tell me how to do this either in eclipse or using the command line approach. I've made JAR files in eclipse 3.0 without any problems and since I upgraded to 3.1 I've run into this issue. I suspect that some of my settings are wrong.

Any help would be greatly appreciated!

-Chris
19 years ago
No, sorry, I meant the wizard in Eclipse that allows you to export JAR files. It allows you to select the main class.

For some reason, the class is not being found in the JAR file.

-CS
19 years ago
Hello all,

I'm attempting to export a JAR file from a package in my Eclipse 3.1 workspace (Windows XP) that contains a class with my main method and for some reason, at runtime I receive an error from the JVM that it cannot find my main class. The class was assigned in the JAR wizard, it is listed in my manifest file, and I've even tried to generate the JAR file from the command line with the same result despite seeing that the main class file was compressed and added to the jar.

Can someone point me in the right direction to correct this? I'm currently running JRE1.5.0_05. Thanks for your help!

Chris Simpkins
19 years ago