aquaballoon

Java: String to Int

Feb 23rd, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. @Action
  2. private void total() {
  3.     int total = 0;
  4.     total+=Integer.parseInt(jTextField1.getText());  // String to Int
  5.     total+=Integer.parseInt(jTextField2.getText());
  6.     total+=Integer.parseInt(jTextField3.getText());
  7.    
  8.     jTextField4.setText(Integer.toString(total));    // Int to String
  9. }
Advertisement
Add Comment
Please, Sign In to add comment