Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package UI;
- import genius.FundoDoJogo;
- import java.awt.Dimension;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Toolkit;
- import java.io.IOException;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- /**
- *
- * @author Gustavo
- */
- public class MeuFrame extends Frame {
- private FundoDoJogo fundoDoJogo;
- public MeuFrame() {
- Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation(dim.width / 2 - this.getSize().width / 2, dim.height / 2 - this.getSize().height / 2);
- this.setVisible(true);
- this.setSize(500, 500);
- try {
- fundoDoJogo = new FundoDoJogo();
- } catch (IOException ex) {
- Logger.getLogger(MeuFrame.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- @Override
- public void paint(Graphics g) {
- Graphics2D g2 = (Graphics2D) g;
- fundoDoJogo.desenha(g2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement