Comincio ad avere qualche problema anche con la gestione dei pulsanti, faccio prima a postare tutto il codice:
Questa è la classe Intro che contiene tre pulsanti che fanno da link
codice:
package postit;
/**
*
* @author alegian
*/
public class Intro extends javax.swing.JPanel {
/** Creates new form Intro */
public Intro() {
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.
*/
private void initComponents() {
bInserisci = new javax.swing.JButton();
bLeggi = new javax.swing.JButton();
bModifica = new javax.swing.JButton();
setLayout(new java.awt.BorderLayout());
setBackground(new java.awt.Color(255, 255, 0));
setMinimumSize(new java.awt.Dimension(200, 200));
setPreferredSize(new java.awt.Dimension(200, 200));
bInserisci.setText("Inserisci");
bInserisci.setMaximumSize(getMaximumSize());
bInserisci.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bInserisciActionPerformed(evt);
}
});
bInserisci.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
bInserisciMouseClicked(evt);
}
});
add(bInserisci, java.awt.BorderLayout.CENTER);
bLeggi.setText("Leggi");
bLeggi.setMaximumSize(getMaximumSize());
bLeggi.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bLeggiActionPerformed(evt);
}
});
add(bLeggi, java.awt.BorderLayout.SOUTH);
bModifica.setText("Modifica");
bModifica.setMaximumSize(getMaximumSize());
add(bModifica, java.awt.BorderLayout.NORTH);
}
private void bInserisciMouseClicked(java.awt.event.MouseEvent evt) {
//
}
private void bLeggiActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void bInserisciActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
// Variables declaration - do not modify
protected javax.swing.JButton bInserisci;
protected javax.swing.JButton bLeggi;
protected javax.swing.JButton bModifica;
// End of variables declaration
}
Questa è la classe Finestra
codice:
package postit;
public class Finestra extends javax.swing.JFrame {
/** Creates new form Finestra */
public Finestra() {
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.
*/
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setName("frame1");
jPanel1.setBackground(new java.awt.Color(255, 255, 0));
getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 200, 200));
pack();
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Finestra().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JPanel jPanel1;
// End of variables declaration
}