JAVA 如何从可选对话框中获取价值
你好,我需要帮助,因为我在堆栈 =D 时遇到了这个问题,我做了一个小程序,现在我做了一个小选项对话框,里面有几个选项我想保存选项你选择为 Int 我该怎么做,这是代码:
final JButton btnOdaberi = new JButton("Odaberi");
btnOdaberi.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
int t = 0;
String[] rate = {"1","2","3","4","5","6","7","8","9","10","11","12"};
int izaberi = JOptionPane.showOptionDialog(btnOdaberi, "Izaberi broj rata", "Rate",0,t,null, rate,"1");
}
提前致谢。