1 Attachment(s)
how to show/open/load JPanel(form) in an external jar
i am beginner in java, i am used to VB.
Here is my case:
1. i've made a desktop application using netbeans
2. it contains main.class that launch the myForm.class.
3. it works when run from its project and netbeans
4. then, i made it became a jar file
5. i put the jar file in a specific folder (eg. as same folder as the new-another desktop app. will load the jar). so, how i should load it when run time (using source code)
PS. i attached my original myForm.class
Re: how to show/open/load JPanel(form) in an external jar
Quote:
how i should load it when run time
Can you explain your problem?
Code executed from a jar should work the same as when executed from files in a folder.
The exception is you need to treat files as resources and use the classloader's getResource methods instead of File reading classes.
You execute the code in a properly constructed jar file by the command: java -jar <THEJARFILENAME>.jar
The jar command is used to create a jar file.