Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: how to show/open/load JPanel(form) in an external jar

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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
    Attached Files Attached Files


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,100
    Thanks
    48
    Thanked 2,153 Times in 2,126 Posts

    Default Re: how to show/open/load JPanel(form) in an external jar

    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.

Similar Threads

  1. Hide/Show Form?
    By chickenhawk in forum What's Wrong With My Code?
    Replies: 11
    Last Post: July 1st, 2011, 06:26 AM
  2. Open JFrame Form With Button
    By cardamis in forum AWT / Java Swing
    Replies: 2
    Last Post: April 12th, 2011, 03:18 AM
  3. Beginner: Show Image in Label when Results Show Up
    By Big Bundy in forum Java Theory & Questions
    Replies: 3
    Last Post: April 4th, 2011, 02:43 PM
  4. J2ME-Show RMS data in tabular form
    By Sunil Raghuvanshi in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: January 24th, 2011, 07:06 AM
  5. **Help!** Capturing external circuit data to GUI Jpanel
    By ROTNEVNI in forum AWT / Java Swing
    Replies: 2
    Last Post: November 27th, 2009, 08:40 AM