• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMenuItem ActionListiner problem

 
Deva Devaa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting jMenuItem ActionListiner problem in MainMenu jFrame for DeleteCustomer jFrame

I want to perform multiple jMenuIteam Listiner operation for multiple JMenuItem given in the MainMenu Jframe. I am successfull for New Customer jFrame but unable to
perform same operation for anothers jMainItem.
So this is the code
Login jFrame



MainMenu COde:





New Customer Code:


Delete Customer :




can any one help me...
thank for the help who want to help me in the advance.
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please refrain from using colours unnecessarily in the future? I couldn't read your yellow text at all, so I have removed the yellow.
 
Deva Devaa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.. but help me
 
Stephan van Hulst
Bartender
Posts: 6583
84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Deva, welcome to CodeRanch!

A quick look makes me question it should perform any actions at all. I don't see where you actually add any action listeners to the menu items. Maybe you should try that first.

It's a very bad idea to make your frames into huge action listeners for all the items though. A much better approach is to create an individual Action for each action (sounds logical, doesn't it?) and then you can add the Actions to menus and toolbars. This has the added benefit that you can reuse actions, and easily disable them if needed. Here's an example:
 
Deva Devaa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for New Customer jFrame i added ActionListiner and its works for it, but whenever i tried to do the same thing for Delete Customer from MainMenu its does not work,i got the error.. then how to solve it
 
Stephan van Hulst
Bartender
Posts: 6583
84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error?

Please post the stack trace you're getting, and the line number in which you're adding the listener.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!