Opening a dialog box from a menuItem
Hi everyone,
I am creating a GUI and i want to be able to open a dialog box from a menuItem, so that when the user clicks on the menuItem the dialog appears.
I was wondering how i could do this using event handlers. Which ones would i need to use.
The menuItem is calledcustomerEdit and the dialog is callededitCustomer.
Im a complete newbie at this, so any help is greatly appreciated
Thanks in advance
Carl
[467 byte] By [
Mr_Carla] at [2007-9-30 23:57:16]

could you show me where to place it in my code?
this is part of the code for my menu bar
salesMenuBar.setBackground(new java.awt.Color(237, 234, 218));
customerMenu.setBackground(new java.awt.Color(236, 233, 216));
customerMenu.setMnemonic('C');
customerMenu.setText("Customer");
customerEdit.setBackground(new java.awt.Color(255, 255, 255));
customerEdit.setMnemonic('E');
customerEdit.setText("Edit/Remove...");
customerEdit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
customerEdit(evt);
}
});
customerMenu.add(customerEdit);
salesMenuBar.add(customerMenu);
managementMenu.setBackground(new java.awt.Color(236, 233, 216));
managementMenu.setMnemonic('M');
managementMenu.setText("Management");
managementLogin.setBackground(new java.awt.Color(255, 255, 255));
managementLogin.setMnemonic('L');
managementLogin.setText("Login...");
managementMenu.add(managementLogin);
salesMenuBar.add(managementMenu);
helpMenu1.setBackground(new java.awt.Color(236, 233, 216));
helpMenu1.setMnemonic('H');
helpMenu1.setText("Help");
helpContent1.setBackground(new java.awt.Color(255, 255, 255));
helpContent1.setMnemonic('n');
helpContent1.setText("Contents");
helpMenu1.add(helpContent1);
helpAbout.setBackground(new java.awt.Color(255, 255, 255));
helpAbout.setMnemonic('A');
helpAbout.setText("About");
helpMenu1.add(helpAbout);
salesMenuBar.add(helpMenu1);
setJMenuBar(salesMenuBar);
pack();
}
private void customerEdit(java.awt.event.ActionEvent evt) {
// Add your handling code here:
}
Thanks again
Carl