import java.awt.Color; import java.awt.Container; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextArea; @SuppressWarnings("serial") public class AsteroidsFrame extends JFrame { private Asteroids game; // TODO: Add Menu items // Panels private JPanel mainPanel; // TODO: Add a panel for the bottom with the Message label, text box, and Send and Connect buttons private JTextArea chatHistory; // Used to store chat messages public AsteroidsFrame() { } public AsteroidsFrame(Asteroids game) { this.game = game; // TODO: Create File menu // Add components to content pane Container contentPane = getContentPane(); mainPanel = new GamePanel(); contentPane.add(mainPanel,"Center"); // TODO: Create bottom panel with Message label, text box, and two buttons // Add this panel to the bottom (South) // contentPane.add(bottomPanel,"South"); // TODO: Create a text area called chatHistory } private class GamePanel extends JPanel { public GamePanel() { setBackground(Color.black); } public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; super.paintComponent(g); game.draw(g2); } } }