Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
edited background colors and fonts
  • Loading branch information
sss13010 committed Apr 7, 2017
1 parent 8e5f596 commit 281c52f
Showing 1 changed file with 52 additions and 8 deletions.
60 changes: 52 additions & 8 deletions src/view/DealCardWindow.java
Expand Up @@ -25,29 +25,34 @@ public class DealCardWindow {
}
private void prepareGUI(){
mainFrame = new JFrame("Deal");

mainFrame.setSize(400,250);
//need to set this to null and position everything manually
mainFrame.setLayout(new GridLayout(3, 1));

mainFrame.getContentPane().setBackground(new Color(38, 230, 58));
mainFrame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent windowEvent){
System.exit(0);
}
});

headerLabel = new JLabel("", JLabel.CENTER);
headerLabel.setFont(headerLabel.getFont().deriveFont(Font.BOLD, 16f));
statusLabel = new JLabel("",JLabel.CENTER);
//new statuslabel of "10% of your whatever is XX dollars"
statusLabel.setSize(350,100);

controlPanel = new JPanel();
controlPanel.setLayout(new FlowLayout());
controlPanel.setBackground(new Color(38, 230, 58));

mainFrame.add(headerLabel);
mainFrame.add(controlPanel);
mainFrame.add(statusLabel);
mainFrame.setVisible(true);

mainFrame2 = new JFrame("Deal");
mainFrame2.getContentPane().setBackground(new Color(38, 230, 58));
mainFrame2.setSize(400,250);
//need to set this to null and position everything manually
mainFrame2.setLayout(new GridLayout(3, 1));
Expand All @@ -57,42 +62,81 @@ public class DealCardWindow {
System.exit(0);
}
});
headerLabel2 = new JLabel("", JLabel.CENTER);
headerLabel2 = new JLabel("", JLabel.CENTER);
headerLabel2.setFont(headerLabel.getFont().deriveFont(Font.BOLD, 16f));
statusLabel2 = new JLabel("",JLabel.CENTER);
//new statusLabel2 of "10% of your whatever is XX dollars"
statusLabel2.setSize(350,100);

controlPanel2 = new JPanel();
controlPanel2.setLayout(new FlowLayout());
controlPanel2.setBackground(new Color(38, 230, 58));

mainFrame2.add(headerLabel2);
mainFrame2.add(controlPanel2);
mainFrame2.add(statusLabel2);
mainFrame2.setVisible(true);
}
private int showButtonDemo() {

private int showButtonDemo(){

headerLabel.setText("Deal");
statusLabel.setText("What type of deal would you like?");

//resources folder should be inside SWING folder.

JButton BigDeal = new JButton("BigDeal");
JButton SmallDeal = new JButton("SmallDeal");
SmallDeal.setHorizontalTextPosition(SwingConstants.LEFT);
JButton AcceptDeal = new JButton("Accept Deal");
JButton DeclineDeal = new JButton("Decline Deal");
DeclineDeal.setHorizontalTextPosition(SwingConstants.LEFT);

BigDeal.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//open big deal stuffs
response = 1;
headerLabel2.setText("Big Deal title goes here");
statusLabel2.setText("Big Deal Description goes here");
controlPanel2.add(AcceptDeal);
controlPanel2.add(DeclineDeal);
mainFrame2.setVisible(true);
AcceptDeal.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//update methods
System.exit(0);
}
});
DeclineDeal.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
}

});

SmallDeal.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
response = 0;
//something to check if stock or not (check via title)

//if not stock
headerLabel2.setText("Small Deal title goes here");
statusLabel2.setText("Small Deal Description goes here");
controlPanel2.add(AcceptDeal);
controlPanel2.add(DeclineDeal);
mainFrame2.setVisible(true);
AcceptDeal.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//update methods
System.exit(0);
}
});
DeclineDeal.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
}
});
controlPanel.add(BigDeal);
Expand Down

0 comments on commit 281c52f

Please sign in to comment.