1

I set a lookAndFeel synthetica theme for the project.After that it is not working(jar file in the dist). Again I removed it and tried.Then it worked. I did clean and build. Tried several themes. They all workedd in the project. But did not run in the dist. What should I do? Please help me..

Hasan Dulanga
  • 73
  • 1
  • 11
  • [please and this one](http://stackoverflow.com/q/20614347/714968) – mKorbel Dec 20 '13 at 14:33
  • I could resolve my problem.I'm sorry that I was used trial version Synthetica.jar. after I bought it and done every thing from the beginning. I resolved it. Thank you for your contribution to resolve it.thank you sir – Hasan Dulanga Jun 12 '14 at 18:43

6 Answers6

3

I have experienced this before in my projects. Most of the time it happen because of using icons and images. When /Icons/calculator.png image in your package, it is not wrong in netbeans like this getClass().getResource("/Icons/Calculator.png"). this is working on netbeans. but not in jar file. you need to rename Calculator.png.

Thusitha Wickramasinghe
  • 1,063
  • 2
  • 15
  • 30
0

use jar file in console (CMD in windows , shell in linux) with this command

java -jar adress-jar-file/jarfileName.jar

then see error in console.

Jeus
  • 486
  • 3
  • 10
  • 26
0

Just Right click on yoru projet in netbeans and select Set Configuration then Customize in the window that appears provide your Main Class by clicking the browse button or writing it manually and Clean and Built again

Muhammad
  • 6,725
  • 5
  • 47
  • 54
  • Thanx for commenting.. I did it Mr.Muhammad. customized main clz for several frames in same projects.. and also I did like this.. I set the lookAndFeel to a jButton with setvisible(true) to the next frame.. The frame I set as main class hadn't any lookAndFeel. then the jar was worked.But didn't allow to click that button.. Until click on that button evry things in that frame is worked.when click on it once, no further function. – Hasan Dulanga Dec 20 '13 at 20:28
0
Plz make sure some points.
1) You have set main class properly.
    Right click on Project-> project properties-> Run-> set Main-Class
2) You have set theme path properly.
3) Your themes are not corrupted.
4) You have build your jar properly.
    Right click on project-> clean and build(Note: Do nothing while it finish building jar)
5) Your lib folder not corrupted (if it is present).
ravibagul91
  • 20,072
  • 5
  • 36
  • 59
  • I did it. created a new project .. And set the main class, add libries correctly.. and clean and build. it is finely run in netbeans.. but not the jar – Hasan Dulanga Dec 25 '13 at 02:43
  • 1
    Make sure that you are running your jar in dist folder only – ravibagul91 Dec 26 '13 at 06:39
  • Thank you for further replying to my problem. I'm sorry that I was used trial version Synthetica.jar. after I bought it and done every thing from the beginning. I resolved it. Thank you for your contribution to resolve it.thank you sir – Hasan Dulanga Jun 12 '14 at 18:42
0

It looks like there maybe something wrong with your setup. In your project properties, under libraries have you by chance added synthetica.jar as a required jar. but m not sure try it

but you can simply do, you could create lib folder manually in your project folder and then paste that jar in that folder then through netbeans go to your project then right click on libraries and then browse to find your project folder open that then click on lib folder that you have created open it then click on jar that you have pasted and that jar file will be added to your project.

Ashish
  • 1,943
  • 2
  • 14
  • 17
  • I did it well. And made a new project now too.. added synthetica.jar and SyntheticaGreenDreamLookAndFeel().. it is finely ran in netbeans..But no run in jar file.. set the frame as main class.. clean and build did for two,three times.. I can't amagine what to do. – Hasan Dulanga Dec 25 '13 at 02:41
0

I could resolve my problem.I'm sorry that I was used trial version Synthetica.jar. after I bought it and done every thing from the beginning. I resolved it. Thank you for your contribution to resolve it.thank you

Hasan Dulanga
  • 73
  • 1
  • 11