button listener help pls.

pls help.

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

< what should i put here? T_T

}

what lines should i put in order for my button to call another form that is from another file. they are already using the same package.

this is the form that i'm trying to call.

package my.dbd;

public classNewEntity extends javax.swing.JFrame {

public NewEntity() {

initComponents();

}

private void initComponents() {

..........

}

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new NewEntity().setVisible(true);

}

});

}

private javax.swing.JButton CancelButton;

private javax.swing.JButton CreateButton;

private javax.swing.JLabel jLabel1;

private javax.swing.JPanel jPanel1;

private javax.swing.JTextField jTextField1;

// End of variables declaration

}

thanks.

[1031 byte] By [Hugakuna] at [2007-10-3 2:53:23]
# 1

1) Swing related questions should be posted in the Swing forum.

2) Use the "Code" formatting tags when posting code so the code is readable.

> what lines should i put in order for my button to call another form that is from another file.

How to you create and show your NewEntity frame? You created an instance of the class and set it visible.

So there is no difference showing another frame or dialog that is defined in a separate class. You simply create an instance of the class and make it visible.

camickra at 2007-7-14 20:42:23 > top of Java-index,Java Essentials,Java Programming...
# 2
sorry. i'll be sure to post it in the right forum next time.thanks for the help btw. i got my error now - i did not make the instance visible.
Hugakuna at 2007-7-14 20:42:23 > top of Java-index,Java Essentials,Java Programming...