我有两个 JComboBox 和一个按钮。如果我从两个组合框中分别选择一个项目并按下名为搜索的按钮,我正在尝试这样做。然后从两个组合框中选择的两个项目将保存在一个新的两个单独的字符串中。
请任何人帮助我解决问题。
这是代码片段
//here is the strings that in the combo box
String lc[] = {"Kolabagan-Dhaka", "Gabtoli-Dhaka", "Fakirapul-Dhaka", "Shaymoli-Dhaka"};
String rc[] = {"Banani-Bogra", "Rangpur","Shatrasta-Bogra"};
//here is my two jcombo box
JComboBox lcCombo = new JComboBox(lc);
JComboBox rcCombo = new JComboBox(rc);
// here is my search button
JButton searchButton = new JButton("Search");