import java.awt.CardLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.Timer;


public class Window {

	protected Context ctx;
	protected Timer timer;
	protected JFrame frame;
	protected JMenuBar menu;
	protected Container contentPane;
	protected CardLayout layout;

	public static void main(String[] args) {
		new Window();
	}

	public Window() {
		frame = new JFrame("Word game");
		frame.getContentPane().setPreferredSize(new Dimension(1280, 720));
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		layout = new CardLayout();

		contentPane = frame.getContentPane();
		contentPane.setLayout(layout);

		try {
			this.ctx = new Context.Factory().setWindow(this).create();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}

		this.timer = new Timer(1000 / Context.TICK, new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					ctx.getGame().tick();
				} catch (IOException ex) {
					ex.printStackTrace();
				}
			}
		});

		contentPane.add(ctx.getMainMenu());
		layout.addLayoutComponent(ctx.getMainMenu(), "main-menu");

		contentPane.add(ctx.getGame());
		layout.addLayoutComponent(ctx.getGame(), "game");

		contentPane.add(ctx.getInstructions());
		layout.addLayoutComponent(ctx.getInstructions(), "instructions");
		
		contentPane.add(ctx.getChangeDifficulty());
		layout.addLayoutComponent(ctx.getChangeDifficulty(), "change-difficulty");

		contentPane.add(ctx.getGameOver());
		layout.addLayoutComponent(ctx.getGameOver(), "game-over");

		layout.show(contentPane, "main-menu");

		menu = new JMenuBar();
		JMenu menuGame = new JMenu("Game");
		JMenuItem menuExit = new JMenuItem("Exit");
		menuExit.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}
		});

		menuGame.add(menuExit);
		menu.add(menuGame);

		frame.pack();
		frame.setLocationRelativeTo(null);
		frame.setResizable(false);
		frame.setFocusable(true);
		frame.addKeyListener(ctx.getGame());

		timer.start();
		frame.setVisible(true);
	}

	public void show(String name) {
		layout.show(contentPane, name);
	}

	public JFrame getFrame() {
		return frame;
	}

	public void setFrame(JFrame frame) {
		this.frame = frame;
	}

	public Context getContext() {
		return ctx;
	}

	public void setContext(Context ctx) {
		this.ctx = ctx;
	}

}

@@ -232,67 +232,11 @@
 Menu
-;%0Aimport javax.swing.JMenuBar;%0Aimport javax.swing.JMenuItem
+Bar
 ;%0Aim
@@ -1753,311 +1753,8 @@
 );%0A%0A
-%09%09menu = new JMenuBar();%0A%09%09JMenu menuGame = new JMenu(%22Game%22);%0A%09%09JMenuItem menuExit = new JMenuItem(%22Exit%22);%0A%09%09menuExit.addActionListener(new ActionListener() %7B%0A%09%09%09@Override%0A%09%09%09public void actionPerformed(ActionEvent e) %7B%0A%09%09%09%09System.exit(0);%0A%09%09%09%7D%0A%09%09%7D);%0A%0A%09%09menuGame.add(menuExit);%0A%09%09menu.add(menuGame);%0A%0A
 %09%09fr

Remove code for MenuBar in Window