无法为第一级菜单项编写处理程序 [英] Unable to write handlers for 1st level menu items

查看:83
本文介绍了无法为第一级菜单项编写处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Java Net Beans 6.5.1创建桌面应用程序。问题是我是java的新手,无法找到为第一级菜单编写事件处理程序的方法。对于Eg:我在最顶层创建Exit并尝试使用System.exit(0);退出应用程序,但它没有工作。同样,其他菜单选项包括添加,编辑,删除等。请帮助紧急



提前感谢。



IB

I am trying to create a desktop application using Java Net Beans 6.5.1. Problem is i am new to java and could not find a way to write the event handlers for the first level menu. For Eg: I create "Exit" on the top most level and tried using System.exit(0); to exit the Application but it didn't worked. Likewise other menu options are "Add", "Edit", "Delete" etc. Please help urgently.

Thanking in advance.

IB

推荐答案

参见http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html [ ^ ]。


这篇关于无法为第一级菜单项编写处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆