Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated names. edited background colors and font
  • Loading branch information
sss13010 committed Apr 7, 2017
1 parent c77cbf9 commit 8e5f596
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/view/ChildCardWindow.java → src/view/ChildWindow.java
Expand Up @@ -4,22 +4,23 @@ import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ChildCardWindow {
public class ChildWindow {

private JFrame mainFrame;
private JLabel headerLabel;
private JLabel statusLabel;
private JPanel controlPanel;

public ChildCardWindow(){
public ChildWindow(){
prepareGUI();
}
public static void main(String[] args){
ChildCardWindow ChildCard = new ChildCardWindow();
ChildCard.showButtonDemo();
ChildWindow ChildWindow = new ChildWindow();
ChildWindow.showButtonDemo();
}
private void prepareGUI(){
mainFrame = new JFrame("Child");
mainFrame.getContentPane().setBackground(new Color(149, 32, 216));
mainFrame.setSize(400,250);
//need to set this to null and position everything manually
mainFrame.setLayout(new GridLayout(3, 1));
Expand All @@ -29,19 +30,21 @@ public class ChildCardWindow {
System.exit(0);
}
});
headerLabel = new JLabel("", JLabel.CENTER);
headerLabel = new JLabel("", JLabel.CENTER);
headerLabel.setFont(headerLabel.getFont().deriveFont(Font.BOLD, 16f));
statusLabel = new JLabel("",JLabel.CENTER);
statusLabel.setSize(350,100);

controlPanel = new JPanel();
controlPanel.setLayout(new FlowLayout());
controlPanel.setBackground(new Color(149, 32, 216));

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

private void showButtonDemo(){
headerLabel.setText("Child");
statusLabel.setText("You have a child!");
Expand Down

0 comments on commit 8e5f596

Please sign in to comment.