Dear all,
I'm newbie in Java language. I get assingment from my teacher to create small project for my final test.
Now, I create a Budget Controlling project using Netbeans.
I have created main class, Login form, menu and MasterBudgetingGroup (addGroupAnggaran).
In menu, I have menuItem. But when I click it, it does not open MasterBudgetingGroup
private void mnMasterGroupAnggaranActionPerformed(java.awt.event.ActionEvent evt) {
addGroupAnggaran frm = new addGroupAnggaran();
jd.add(frm);
frm.show();
}
jd is JdesktopPane.
this is code of masterBudgetingGroup :
public class addGroupAnggaran extends javax.swing.JPanel {
/** Creates new form addSubAnggaran */
public addGroupAnggaran() {
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.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
txtKodeSubAnggaran = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
txtNamaSubAnggaran = new javax.swing.JTextField();
cmdNew = new javax.swing.JButton();
cmdEdit = new javax.swing.JButton();
cmdSave = new javax.swing.JButton();
cmdCancel = new javax.swing.JButton();
cmdDelete = new javax.swing.JButton();
cmdExit = new javax.swing.JButton();
jLabel2.setText("Nama Group Anggaran");
cmdNew.setText("Tambah");
cmdEdit.setText("Rubah");
cmdSave.setText("Simpan");
cmdCancel.setText("Batal");
cmdDelete.setText("Hapus");
cmdExit.setText("Keluar");
cmdExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmdExitActionPerformed(evt);
}
});
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(138, 138, 138)
.add(txtKodeSubAnggaran, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(layout.createSequentialGroup()
.add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 134, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(txtNamaSubAnggaran, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE))
.add(layout.createSequentialGroup()
.add(cmdNew)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(cmdEdit)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(cmdSave)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(cmdCancel)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(cmdDelete)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(cmdExit))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(txtKodeSubAnggaran, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel2)
.add(txtNamaSubAnggaran, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(cmdNew)
.add(cmdEdit)
.add(cmdSave)
.add(cmdCancel)
.add(cmdDelete)
.add(cmdExit))
.add(522, 522, 522))
);
}// </editor-fold>
private void cmdExitActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
setVisible(false);
}
// Variables declaration - do not modify
private javax.swing.JButton cmdCancel;
private javax.swing.JButton cmdDelete;
private javax.swing.JButton cmdEdit;
private javax.swing.JButton cmdExit;
private javax.swing.JButton cmdNew;
private javax.swing.JButton cmdSave;
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField txtKodeSubAnggaran;
private javax.swing.JTextField txtNamaSubAnggaran;
// End of variables declaration
}
Please help me, because I can not start to next forms.
Thanks,
Kusno