Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import java.awt.image.BufferedImage;
- import javax.swing.JPanel;
- public class Plansza extends JPanel {
- private BufferedImage klocki;
- private final int blockSize=30;
- private final int boardWidth=10;
- private final int boardHeight=20;
- private int[][] board = new int[boardWidth][boardHeight];
- public void paintComponent(Graphics g) {
- super.paintComponent(g);
- for(int i=0; i<boardHeight; i++) {
- g.drawLine(0, i*blockSize, boardWidth*blockSize, i*blockSize);
- }
- for(int j=0;j<boardWidth;j++) {
- g.drawLine(j*blockSize, 0, j*blockSize, boardHeight*blockSize);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement