/**
*
* @author 1mpulso
*/
public class NewJFrame
extends javax.
swing.
JFrame {
/** Creates new form NewJFrame */
public NewJFrame() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1
= new javax.
swing.
JPanel(); jButton1
= new javax.
swing.
JButton(); jButton2
= new javax.
swing.
JButton(); jButton3
= new javax.
swing.
JButton(); jPanel2
= new javax.
swing.
JPanel();
setMinimumSize
(new java.
awt.
Dimension(500,
300)); getContentPane
().
setLayout(new javax.
swing.
BoxLayout(getContentPane
(), javax.
swing.
BoxLayout.
LINE_AXIS));
jPanel1.
setBorder(javax.
swing.
BorderFactory.
createTitledBorder("P. Izquierdo")); jPanel1.
setLayout(new java.
awt.
GridLayout(5,
1,
5,
5));
jButton1.setText("jButton1");
public void actionPerformed
(java.
awt.
event.
ActionEvent evt
) { jButton1ActionPerformed(evt);
}
});
jPanel1.add(jButton1);
jButton2.setText("jButton2");
public void actionPerformed
(java.
awt.
event.
ActionEvent evt
) { jButton2ActionPerformed(evt);
}
});
jPanel1.add(jButton2);
jButton3.setText("jButton3");
jPanel1.add(jButton3);
getContentPane().add(jPanel1);
jPanel2.
setBorder(javax.
swing.
BorderFactory.
createTitledBorder("P. Derecho")); getContentPane().add(jPanel2);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed
(java.
awt.
event.
ActionEvent evt
) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here:
jPanel2.removeAll();
NewJPanel p0 = new NewJPanel();
jPanel2.add(p0);
jPanel2.updateUI();
jPanel2.repaint();
repaint();
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed
(java.
awt.
event.
ActionEvent evt
) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here:
jPanel2.removeAll();
NewJPanel1 p1 = new NewJPanel1();
jPanel2.add(p1);
jPanel2.updateUI();
jPanel2.repaint();
repaint();
}//GEN-LAST:event_jButton2ActionPerformed
/**
* @param args the command line arguments
*/
public static void main
(String args
[]) { /* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
if ("Nimbus".equals(info.getName())) {
javax.
swing.
UIManager.
setLookAndFeel(info.
getClassName()); break;
}
}
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
public void run() {
new NewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.
swing.
JButton jButton1
; private javax.
swing.
JButton jButton2
; private javax.
swing.
JButton jButton3
; private javax.
swing.
JPanel jPanel1
; private javax.
swing.
JPanel jPanel2
; // End of variables declaration//GEN-END:variables
}
/**
*
* @author 1mpuls0
*/
public class NewJPanel
extends javax.
swing.
JPanel {
/** Creates new form NewJPanel */
public NewJPanel() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
setBorder
(javax.
swing.
BorderFactory.
createTitledBorder("Panel0"));
jRadioButton1.setText("jRadioButton1");
add(jRadioButton1);
jCheckBox1.setText("jCheckBox1");
add(jCheckBox1);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
add(jScrollPane1);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
// End of variables declaration//GEN-END:variables
}
/**
*
* @author 1mpuls0
*/
public class NewJPanel1
extends javax.
swing.
JPanel {
/** Creates new form NewJPanel1 */
public NewJPanel1() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jButton1
= new javax.
swing.
JButton();
setBorder
(javax.
swing.
BorderFactory.
createTitledBorder("Panel1"));
jButton1.setText("jButton1");
add(jButton1);
add(jComboBox1);
jTextField1.setText("jTextField1");
add(jTextField1);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.
swing.
JButton jButton1
; // End of variables declaration//GEN-END:variables
}