0
我已經創建了一個JRadioButton組,並且我想在選擇特定按鈕時將參數設置爲值。我已將ActionListener添加到此按鈕中,如代碼。但我怎麼能在其他行動聽衆中使用這個值?如何從ActionListener獲取值
grid_rb.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent arg0) {
network_type = "--grid-net";
}
});