Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- public class Table extends JPanel {
- private static final long serialVersionUID = -907389172333757537L;
- private Image img = (new ImageIcon(this.getClass().getResource("/img/Queen.png")))
- .getImage();
- public Table() {
- setBackground(Color.GREEN);
- setPreferredSize(new Dimension(1024, 768));
- setLayout(null);
- repaint();
- }
- protected void paintComponent(Graphics g) {
- super.paintComponent(g);
- g.drawImage(img, 0, 0, this);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement