I've been playing around with flex box and I would like to center the "Logo" test in the upper left corner vertically in its blue container.

You can see it here: <http://codepen.io/TimRos/pen/MwKNgw>

```
* {
    margin: 0;
    padding: 0;
}
.box {
    color: white;
    font-size: 80px;
    text-align: center;
    text-shadow: 4px 4px 3px black;
}

/* COLORS & Style
===================================== */

.main-header    {   background: #e3e3e3;    }
.main-footer    {   background: #e3e3e3;    }
.main-content   {   background: #e3e3e3;    }

.main-wrapper {
    box-shadow: 2px 2px 10px #333;
}

.main-wrapper {
    width: 80%;
    margin: 0 auto;
}

/* HEAD
===================================== */

.main-header {
    width: 100%;
    height: 100px;
    border-bottom: 1px solid black;
}

.main-nav {
    list-style: none;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-end;
    align-items: flex-end;
    height: 100%;

}

.main-nav li {
    margin-left: 8px;
    margin-right: 8px;
}

#logo {
    margin-right: auto; /* Align Logo to Left, Nav to the right*/
    margin-left: 0;
    align-self: center;
}

.main-nav li:last-child {
    margin-right: 0;
}

.main-nav li {
    background-color: #3f8abf;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom: 4px solid firebrick;

}
.main-nav a {
    text-decoration: none;
    color: white;
    text-align: center;
    font-weight: bold;
    padding: 8px 15px;
    display: block;
    width: 100px;
}

#logo {
    border-top-left-radius: 0;
    border-bottom-right-radius: 5px;
    border-bottom: 0;
    border-left: 4px solid firebrick;
    padding: 0;
    height: 100%;

}

#logo h1 {
    padding: 0;
    margin: 0;
}

/* CONTENT
===================================== */

.main-content {
    padding: 15px;
}
h3 {
    margin-bottom: 15px;
}

/* FOOTER
===================================== */

.main-footer {
    border-top: 1px solid black;
    text-align: center;
    padding: 5px;
}

```

I tried margin and padding auto but that doesnt seem to work, please help!
['https://Stackoverflow.com/questions/30189605', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4400418/']
This approach uses a public enum and sets the style variable according to the users menu choice:

```
package chess;
//...
public class Screen extends JFrame
        implements ActionListener {

    private JMenuItem random = new JMenuItem("Random");
    private JMenuItem aggressive = new JMenuItem("Aggressive");
    private JMenuItem human = new JMenuItem("Human");

    public enum PlayStyle {Random, Aggressive, Human};
    private PlayStyle style;

    public Screen(Board board) {

        //menuBar items
        menu.add(random);
        random.addActionListener(this);
        menu.add(aggressive);
        aggressive.addActionListener(this);
        menu.add(human);
        human.addActionListener(this);
        //....
        //sets up board of buttons and adds actionListener to each.  
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == random) {
            style=PlayStyle.Random;
        }
        if (e.getSource() == aggressive) {
            style=PlayStyle.Aggressive;
        }
        if (e.getSource() == human) {
            style=PlayStyle.Human;
        }

        //code for the board buttons - nothing to do with the menu. 
        //....
    }
    public PlayStyle getStyle(){
        return style;
    }

}

```

This is the class that contains the main method:

```
package chess;

import chess.Screen.PlayStyle;

public class Chess{

     public static void main(String [ ] args){
         Screen s = new Screen(board);

         // this attempt will work
         if (s.getStyle()==PlayStyle.Random) {
             ...
         } else if (s.getStyle()==PlayStyle.Aggressive){
             ...

```
You are calling a method and it seems that you want to use something that comes back from that method but the method itself returns nothing, i.e. "void". I changed your Screen class so that the method returns something now.

```
public class Screen extends JFrame
                    implements ActionListener {
  public Source actionPerformed(ActionEvent e) {

    ....

    if(e.getSource() == random){

    }
    if(e.getSource() == aggressive){

    }
    if(e.getSource() == human){

    }

    return e.getSource()
}

```

The main method will now be able to receive a result from the call and use it.