2011-04-12 42 views
1

我不太確定我在做什麼錯誤的代碼。java joption並將字符串轉換爲整數

我試圖導入的JOptionPane然後轉換字符串轉換成一個int 我的錯誤出現在

**start = inputValue.Integer.parseInt();** 
JOptionPane pane = new JOptionPane(); 

String inputValue = JOptionPane.showInputDialog("Please input a value"); 
start = inputValue.Integer.parseInt(); 

回答

2

試試這個:

start = Integer.parseInt(inputValue);

+0

感謝那個工作的人 – user703141 2011-04-12 00:44:55

1

我認爲你的意思start = Integer.parseInt(inputValue);