aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JFrame & Jar Files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame & Jar Files" Watch "JFrame & Jar Files" New topic
Author

JFrame & Jar Files

Hetal Seth
Greenhorn

Joined: Jun 18, 2001
Posts: 20
Hi Folks:
problem:
i have made an single program application usin JFrame.it works when i run it from aDOS prompt. but i want to make it clickable ie make an icon, so i created a jar file n made the JFrame class as manifest, but it doenst not work and gives an error :
i would appreciate ur help.
*********************
Exception occurred during event dispatching:
java.lang.NoClassDefFoundError: org/w3c/dom/DOMException
at QuoteInfoLogging.actionPerformed(QuoteInfoLogging.java:445)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.
66)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed
ctButton.java:1101)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButt
.java:378)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.j
)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Basic
istener.java:204)
at java.awt.Component.processMouseEvent(Component.java:3165)
at java.awt.Component.processEvent(Component.java, Compiled Code)
at java.awt.Container.processEvent(Container.java, Compiled Code)
at java.awt.Component.dispatchEventImpl(Component.java, Compiled
at java.awt.Container.dispatchEventImpl(Container.java, Compiled
at java.awt.Component.dispatchEvent(Component.java, Compiled Code
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.ja
piled Code)
at java.awt.LightweightDispatcher.processMouseEvent(Container.jav
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:17
at java.awt.Container.dispatchEventImpl(Container.java, Compiled
at java.awt.Window.dispatchEventImpl(Window.java:749)
at java.awt.Component.dispatchEvent(Component.java, Compiled Code
at java.awt.EventQueue.dispatchEvent(EventQueue.java, Compiled Co
at java.awt.EventDispatchThread.pumpOneEventForComponent(EventDis
read.java, Compiled Code)
at java.awt.EventDispatchThread.pumpEventsForComponent(EventDispa
ad.java:95)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.ja
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Thanks,
Hetal
Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
Hi Hetal,
The problem is not with your jar file, as it is running fine. You need to add the reference of the JAXP, Crimson, and Xalan jar files to your classpath. If you set it in a dosprompt window the settings are temporary and are for only that window. Either add the classpath setting to the autoexec.bat (win 9x) or system environment properties (win 2k). Alternatively you could simply copy the jar files in your JVM's /lib/ext folder. Do make a copy in both the jvm's viz. the jdk and the jre (in Program Files folder).
Regards,
Amit
Jagan Mohan Reddy
Greenhorn

Joined: May 15, 2001
Posts: 18
Hi,
I think u can also execute it using a batch file.
The Batch File Content Is something like this.
For Suppose ur application jar file is in D:\application.
Let the jar file be application.jar
Let the JFrame class be FrameClass.java
execute.bat
===========

set classpath=%classpath%;D:\application\application.jar
java FrameClass

The execute.bat file should be in the folder D:\application
Hope this solves ur problem.

Regards,
Jagan Mohan Reddy
Hetal Seth
Greenhorn

Joined: Jun 18, 2001
Posts: 20
hey amit:
well i found the solu.
anyways thanks alot !
hetal seth
[This message has been edited by Hetal Seth (edited June 19, 2001).]
Hetal Seth
Greenhorn

Joined: Jun 18, 2001
Posts: 20
Hi Jagan:
hey dude that was awesome !
it worked great. i was tryin for somethin like 4-5 days, n ur stuff took just 4 mins.
But how can I avoid the dos window from poping up ?
i appreciate ur assistance.
Thanks alot,
Hetal Seth

[This message has been edited by Hetal Seth (edited June 19, 2001).]
Jagan Mohan Reddy
Greenhorn

Joined: May 15, 2001
Posts: 18
Hi,
I think this be done only through windows programing which i dont know.The dos prompt that open will help to check ur output messages. If u know how to minimize the dos-prompt pls do mail me. mailid:reddychatla@systemlogicindia.com
Regards,
Jagan Mohan Reddy.
Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
Hi Hetal,
try using javaw instead of java to execute your class from the batch file.
-------
Amit
 
wood burning stoves
 
subject: JFrame & Jar Files