Results 1 to 6 of 6
  1. #1
    xcoder is offline Member
    Join Date
    Mar 2012
    Posts
    4
    Rep Power
    0

    Default Running Class wrapped on a library on Click of Button in netbeans

    I created a module for my project.I have wrapped a library with a class that has a main method.I now want to run the class when a menu is clicked on the platform.How do I do this?

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,396
    Rep Power
    25

    Default Re: Running Class wrapped on a library on Click of Button in netbeans

    Create a jar file with the class files and a manifest file. Your IDE can probably do it all.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    xcoder is offline Member
    Join Date
    Mar 2012
    Posts
    4
    Rep Power
    0

    Default Re: Running Class wrapped on a library on Click of Button in netbeans

    How do i create a jar and manifest .?

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,396
    Rep Power
    25

    Default Re: Running Class wrapped on a library on Click of Button in netbeans

    I use the jar command. See the tutorial for details:
    Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    xcoder is offline Member
    Join Date
    Mar 2012
    Posts
    4
    Rep Power
    0

    Default Re: Running Class wrapped on a library on Click of Button in netbeans

    Thanks.I have done that sucessfully.So How Do I now Run a certain class(It is a form) inside the jar when an action like a menu click is invoked in the netbeans platform?
    All my classes are CRUD generated forms.

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,396
    Rep Power
    25

    Default Re: Running Class wrapped on a library on Click of Button in netbeans

    How Do I now Run a certain class
    When the code in the jar file is started by double clicking on the jar file, you can "run" a class by creating an instance of the class and calling its methods. The manifest file tells java which class has the main() method that the java program is supposed to call to start the execution.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 5
    Last Post: 02-25-2012, 03:56 AM
  2. Replies: 7
    Last Post: 12-18-2011, 04:13 AM
  3. Replies: 2
    Last Post: 06-22-2011, 01:19 PM
  4. running jar file by double click
    By Himanshu23 in forum AWT / Swing
    Replies: 0
    Last Post: 11-11-2010, 08:24 AM
  5. SaveAs button click
    By kasiram.p@gmail.com in forum AWT / Swing
    Replies: 2
    Last Post: 07-06-2010, 08:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •