Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void actionPerformed(ActionEvent e){
- switch(e.getSource()){
- case radius:
- double r = validate(radius.getText());
- break;
- case height:
- double h = validate(height.getText());
- break;
- case out:
- out.setText(String.valueOf(h*r));
- break;
- }
- }
- public void actionPerformed(ActionEvent e){
- if (e.getSource() == radius) {
- double r = validate(radius.getText());
- else if (e.getSource() == height) {
- double h = validate(height.getText());
- else if (e.getSource() == out) {
- out.setText(String.valueOf(h*r));
- }
- }
- switch(e.getActionCommand()) {
- case: "Radius":
- ....
- case: "Height":
- ....
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement