Hi,
I'm trying to use JAVA GUI for first time.
I've got a Jframe that when loaded adds a jpanel. the problem is it will not show any swing controls that get added to the jPanel.
I'm using netbeans 6.9.1.
any idea to why is happerning would be greatful
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* testing.java
*
* Created on 03-Dec-2010, 16:46:54
*/
package Test;
/**
*
* @author e1159789
*/
public class testing extends javax.swing.JFrame {
/** Creates new form testing */
public testing() {
initComponents();
this.add(jPanel1);
this.validate();
this.repaint();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.remove(jPanel1);
this.add(jPanel2);
this.validate();
this.repaint();
}
private void button1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.remove(jPanel1);
this.add(jPanel2);
this.validate();
this.repaint();
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new testing().setVisible(true);
}
});
}
// Variables declaration - do not modify
private java.awt.Button button1;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JList jList1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JPasswordField jPasswordField2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private java.awt.Label label1;
private java.awt.TextArea textArea1;
private java.awt.TextField textField1;
// End of variables declaration
}
Note: ive deleted the chunk of generated code so it dont spam the forum.