Skip to content

Commit

Permalink
changed illegal action to checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Omp06 committed Dec 15, 2023
1 parent 8ae1421 commit e3fef12
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/main/java/stock/view/Gui.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public class Gui implements GameObserver {
JLabel walletLabel;
JLabel transferLabel;
JLabel debt;
JCheckBox illegal;


//private static void createAndShowGUI() {
Expand Down Expand Up @@ -245,15 +246,18 @@ public void actionPerformed(ActionEvent e){
}
});

JButton illegal = new JButton("Illegal Action");
/* JButton illegal = new JButton("Illegal Action");
illegal.setOpaque(true);
illegal.setAlignmentY(Component.CENTER_ALIGNMENT);
illegal.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
update();
}
});
}); */

this.illegal = new JCheckBox("Commit Illegal Action?");


this.totalPortfolio = new JLabel("Total cash: " + player.getCapital());
this.totalPortfolio.setHorizontalAlignment(SwingConstants.CENTER);
Expand Down Expand Up @@ -593,6 +597,9 @@ public void update(){
frame.setVisible(false);
this.end = new gameOver();

}
if(this.illegal.isSelected()){

}
this.marketPrices = controller.marketstockprices();
this.userNames = controller.userstocknames();
Expand Down

0 comments on commit e3fef12

Please sign in to comment.