Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public void actionPerformed(ActionEvent e){
  2. switch(e.getSource()){
  3. case radius:
  4. double r = validate(radius.getText());
  5. break;
  6. case height:
  7. double h = validate(height.getText());
  8. break;
  9. case out:
  10. out.setText(String.valueOf(h*r));
  11. break;
  12. }
  13. }
  14.  
  15. public void actionPerformed(ActionEvent e){
  16. if (e.getSource() == radius) {
  17. double r = validate(radius.getText());
  18. else if (e.getSource() == height) {
  19. double h = validate(height.getText());
  20. else if (e.getSource() == out) {
  21. out.setText(String.valueOf(h*r));
  22. }
  23. }
  24.  
  25. switch(e.getActionCommand()) {
  26. case: "Radius":
  27. ....
  28. case: "Height":
  29. ....
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement