Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.Color;
- import java.awt.Graphics;
- public class TowerDefense extends JFrame {
- //GUI Object
- public static TowerDefense gui = new TowerDefense();
- //Brown color used for HUD
- public static Color brown = new Color (139,69,19);
- //Method to launch GUI Window
- public static void LaunchGUI()
- {
- gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- gui.setSize(1920,1080);
- gui.setVisible(true);
- gui.setTitle("Tower Defense");
- gui.setResizable(false);
- }
- //Graphics method
- public static void paintComponent(Graphics g)
- {
- gui.paintComponents(g);
- g.setColor(Color.black);
- g.drawRect(100, 100, 1920, 100);
- gui.repaint();
- }
- public static void main(String[] args)
- {
- // TODO Auto-generated method stub
- LaunchGUI();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement