public GameRunner() throws Exception{ // Create a maze and a view component model = new Maze(MAZE_DIMENSION); view = new GameView(model); // Add sprites to the view component Sprite[] sprites = getSprites(); view.setSprites(sprites); // Place the player in the maze and start a timer placePlayer(); // Set the dimensions of the maze game to 1000x1000 Dimension d = new Dimension(GameView.DEFAULT_VIEW_SIZE, GameView.DEFAULT_VIEW_SIZE); view.setPreferredSize(d); view.setMinimumSize(d); view.setMaximumSize(d); // A label above the game view which will display the current stats of the player information.setText(" Health: " + Double.toString(spartan.getHealth()) + " Durability: " + spartan.getDurability() + " Anger: " + spartan.getAnger() + " Bombs: " + spartan.getBomb() + " H-Bombs " + spartan.gethBomb()); information.setBackground(Color.BLACK); information.setForeground(Color.WHITE); information.setOpaque(true); JFrame f = new JFrame("GMIT - B.Sc. in Computing (Software Development)"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.addKeyListener(this); f.getContentPane().setLayout(new VerticalLayout()); f.add(information); f.add(view); f.setSize(1000,1000); f.setLocation(100,100); f.pack(); f.setVisible(true); }
@Override protected JComponent getDialogContent() { final DCPanel contentPanel = new DCPanel(); contentPanel.setLayout(new GridBagLayout()); final DCPanel listPanel = new DCPanel(); listPanel.setBackground(WidgetUtils.COLOR_WELL_BACKGROUND); listPanel.setLayout(new VerticalLayout()); listPanel.add(_serverList); final DCLabel label = DCLabel.dark("Please select the Hadoop cluster to connect to:"); label.setFont(WidgetUtils.FONT_HEADER2); WidgetUtils.addToGridBag(label, contentPanel, 0, 0, 1.0, 0.0); WidgetUtils.addToGridBag(listPanel, contentPanel, 0, 1, 1, 2, GridBagConstraints.NORTH, 10, 1.0, 1.0); WidgetUtils.addToGridBag(_optionsButton, contentPanel, 1, 1, GridBagConstraints.SOUTH); WidgetUtils.addToGridBag(_okButton, contentPanel, 1, 2, GridBagConstraints.NORTH); final JScrollPane scrolleable = WidgetUtils.scrolleable(contentPanel); scrolleable.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); final DCPanel outerPanel = new DCPanel(WidgetUtils.COLOR_DEFAULT_BACKGROUND); outerPanel.setLayout(new BorderLayout()); outerPanel.add(scrolleable, BorderLayout.CENTER); outerPanel.setPreferredSize(getDialogWidth(), 300); return outerPanel; }
public BitThiefGUI(Environment environment) { this.environment = environment; window = createWindow(); window.setLayout(new BorderLayout()); boardsContainer = new JPanel(new VerticalLayout()); window.add(boardsContainer, BorderLayout.CENTER); }