Laptop test so I can work on both desktop and laptop & added some code for scissors
This commit is contained in:
parent
8e4b96f969
commit
f8a6411730
@ -19,11 +19,11 @@ public class Rock_paper {
|
||||
|
||||
JButton rockbutton = new JButton("rock");
|
||||
JButton paperbutton = new JButton("paper");
|
||||
JButton sissorsButton = new JButton("scissors");
|
||||
JButton scissorsbutton = new JButton("scissors");
|
||||
JPanel panel = new JPanel();
|
||||
panel.add(rockbutton);
|
||||
panel.add(paperbutton);
|
||||
panel.add(sissorsButton);
|
||||
panel.add(scissorsbutton);
|
||||
rockbutton.addActionListener(new ActionListener(){
|
||||
public void actionPerformed(ActionEvent e){
|
||||
rock = true;
|
||||
@ -46,6 +46,18 @@ public class Rock_paper {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
scissorsbutton.addActionListener(new ActionListener(){
|
||||
public void actionPerformed(ActionEvent e){
|
||||
scissors = true;
|
||||
if(scissors == true) {
|
||||
paper = false;
|
||||
scissors = false;
|
||||
System.out.println("paper is true");
|
||||
};
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
frame.add(panel);
|
||||
|
Loading…
Reference in New Issue
Block a user