0

I have two main class in my netbeans project, and in one program I am calling the other Class

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         

                NewJFrame k = new NewJFrame();
                k.setVisible(true);
                //close();

Both the programs are running fine independently , and if I run one program then using above button action my new form from the other class is opening, I mean in netbeans everything is working as expected.

But if when I am making jar file and running it , then it runs but the another form is not opening when I click on the button,

Please help me..

user3065757
  • 475
  • 1
  • 5
  • 14
  • 1
    what is the exception/error message ? – jmj Dec 20 '13 at 14:18
  • http://wiki.netbeans.org/PackagingADistributableJavaApp – Anthony Accioly Dec 20 '13 at 14:19
  • [this](http://stackoverflow.com/questions/194698/how-to-load-a-jar-file-at-runtime) might help – msam Dec 20 '13 at 14:20
  • no error message as while clicking on .jar file it is running but while clicking over button the second frame is not opening – user3065757 Dec 20 '13 at 14:25
  • Please post your NewJFrame class; the two lines of code above are not obviously wrong. – Elliott Frisch Dec 20 '13 at 14:27
  • public class NewJFrame extends javax.swing.JFrame { //Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con = null; ResultSet rs = null; Statement st = null; PreparedStatement pst =null; public NewJFrame() throws SQLException, ClassNotFoundException { initComponents(); //setIcon(); reset.setEnabled(false); submit.setEnabled(false); //fillCombo(); } – user3065757 Dec 23 '13 at 06:23

0 Answers0