key event not work after making jar file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vikassawant
    New Member
    • Mar 2009
    • 27

    #1

    key event not work after making jar file

    hi,
    I write one file with two buttons.Code for that is as fallow.

    public void actionPerformed (ActionEvent e)
    {
    try
    {

    if(e.getSource( )==cancel)
    {
    frame.hide();

    }

    else if(e.getSource( )==create)
    {

    category[0] =(String)Oone.g etSelectedItem( );
    category[1] =(String)Otwo.g etSelectedItem( );
    category[2] =(String)Othree .getSelectedIte m();
    category[3] =(String)Ofour. getSelectedItem ();

    wv1=(String)w1. getSelectedItem ();
    wv2=(String)w2. getSelectedItem ();

    sv1=(String)s1. getSelectedItem ();
    sv2=(String)s2. getSelectedItem ();

    erav1=(String)e ra1.getSelected Item();
    erav2=(String)e ra2.getSelected Item();

    whipv1=(String) whip1.getSelect edItem();
    whipv2=(String) whip2.getSelect edItem();


    final Automatic automatic = new Automatic(categ ory[0],category[1],category[2],category[3],category[4],category[5],category[6],category[7]);

    frame.setConten tPane(automatic );

    frame.setVisibl e(true);
    }

    }catch(Exceptio n e1)
    {
    System.out.prin tln("hi..."+e1) ;
    }

    }

    There is two Buttons 1.Create Team 2.Cancel
    This both the buttons work at command prompt.but when I make the jar file of this whole project only cancel button works, another button Create Team doesn't perform any action.

    I can't understand what is the reason behind this.

    Thanks In advance.

    Thanks,
    Vikas Sawant.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Do you mean that the code works correctly when you run the class files but doesn't work when you package the class files inside a jar file?
    Are you sure you are including the correct class files when making the jars? Perhaps there is an old class file somewhere which is being included instead of the one that works.

    Comment

    • vikassawant
      New Member
      • Mar 2009
      • 27

      #3
      Yes. you are Right.

      When I delete all old class files from folder and make new Jar file then it works fine.

      Thanks,
      Vikas Sawant.

      Comment

      Working...