组合框动作监听器 [英] Combobox action listener
本文介绍了组合框动作监听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在我的组合框中添加actionlistener.
这是我的代码.
I need to add actionlistener to my combobox.
Here''s my code..
private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String[] comboTypes = { "PDS" , "Salary Adjustment" , "Leave"};
JComboBox comboTypesList = JComboBox(comboTypes);
comboTypesList.setSelectedIndex(0);
JOptionPane.showMessageDialog( comboTypesList , "PDS");
推荐答案
抱歉,您想在哪里添加动作侦听器?此代码只是其动作侦听器的替代方法...
这个ActionListener是做什么的?
Sorry, where do you want add an action listener?This code is just an override method of its action listener...
What does this ActionListener do?
这篇关于组合框动作监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文