正在加载图片...
Jbutton方法 可以通过 setTexto动态地改变按钮上的显示 文本,通过 setEnabled(改变按钮的状态 程序8-2 JButton Example2 回以蠱 JButton Example2 You have pressed the Button! You have pressed the button Sample Disable Sample Sample Enable Sample 因此当事件发生时,判断是在哪一个按钮上发 生的Jbutton方法 § 可以通过setText()动态地改变按钮上的显示 文本,通过setEnabled()改变按钮的状态 § 程序8-2 § setMnemonic()方法可以为按钮设置快捷键 § setActionCommand()方法为按钮设置一个命 令名 § getActionCommand()方法 § 因此当事件发生时,判断是在哪一个按钮上发 生的 b1.setMnemonic(KeyEvent.VK_S);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有