Code As Follows:
MainForm.java // It will display the main form with menu
package practise;
public class MainForm extends javax.swing.JFrame {
/** Creates new form MainForm */
public MainForm() {
initComponents();
}
private void initComponents() {
jContainer = new javax.swing.JDesktopPane();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
mnuCustomer = new javax.swing.JMenuItem();
mnuItem = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem3 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jMenu1.setText("Forms");
mnuCustomer.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.ALT_MASK));
mnuCustomer.setText("Customer");
mnuCustomer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mnuCustomerActionPerformed(evt);
}
});
jMenu1.add(mnuCustomer);
mnuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
mnuItem.setText("Item");
mnuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mnuItemActionPerformed(evt);
}
});
jMenu1.add(mnuItem);
jMenuBar1.add(jMenu1);
jMenu2.setText("File");
jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.ALT_MASK));
jMenuItem3.setText("Exit");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem3);
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jContainer, javax.swing.GroupLayout.DEFAULT_SIZE, 418, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jContainer, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}
private void mnuCustomerActionPerformed(java.awt.event.ActionEvent evt) {
CustomerView cv=new CustomerView();
jContainer.add(cv);
cv.setVisible(true);
}
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void mnuItemActionPerformed(java.awt.event.ActionEvent evt) {
ItemForm iv=new ItemForm();
jContainer.add(iv);
iv.setVisible(true);
}
/**
* @param args the command line arguments
*/
public static void main(
String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainForm().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JDesktopPane jContainer;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem mnuCustomer;
private javax.swing.JMenuItem mnuItem;
// End of variables declaration
}
then ItemForm.java // code pasted on first part
but i am not getting the buttons
is it clear or i will paste here only