Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Window {
- public static final int WIDTH = 307, HEIGHT = 630;
- private JFrame window;
- private Board board;
- public Window(){
- window = new JFrame("Tetris Game");
- window.setSize(WIDTH, HEIGHT);
- window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- window.setResizable(false);
- window.setLocationRelativeTo(null);
- board = new Board();
- window.add(board);
- window.setVisible(true);
- }
- public static void main(String[] args) {
- new Window();
- }
- }
- public class Board extends JPanel {
- public Board(){
- }
- @Override
- public void paintComponents(Graphics g) {
- g.setColor(Color.RED);
- g.fillRect(0, 0, 300,600);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement