• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to run pgm. when in jar....

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am using 4 Jframes and correspondigly 4 java classes for them. The program runs fine. But when i package it in jar file while giving the manifest info with the mainclass; the first frames runs ok but when i press submit button what happens is i create the object of another class and this is where the program gets stuck what could be the reason???
The constructor of the class which is called contains the tools to make the 2nd frame. But it does not event enters the constructor.

I am extending JFrame in all the classes and using ContentPane and adding componenets to it. and i am doing all this in the constructor of each class.


Thanks.
Robin
[ June 14, 2008: Message edited by: robin singal ]
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly do you mean by "gets stuck"?
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By get stuck i mean :

I am using setTitle() to know exactly where i am in the code...
So after the setTitle() the control goes to the formation of an object which is assigned to the static variable of that class type...
But the control does not go into the constructor of that class whose object is created. Event i have user setTitle in exception there is also no exception raised.
Why the program that runs in console does not run with the jar file??
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to ellaborate the situation... :



Now the Otherclass constructor contains the code to make another frame.
by getting contentPane and setting layout and adding the required components.
But the Jframe does not appear but it does when i run the program in console??///

Thanks
[ June 16, 2008: Message edited by: robin singal ]
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I received the error:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: OtherClass..
...
....
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry

It was a silly mistake I forgot to include cureent directory in the manifest file..

Thanks
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic