Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Graphics;
- import javax.swing.JPanel;
- public class JWhiteBoard extends JPanel {
- private int rows = 10;
- private int cols = 10;
- public void paintComponent(Graphics g) {
- for (int i=0;i<cols;i++){
- for (int j=0;j<rows;j++){
- g.drawOval(i*10,j*10,10,10);
- }
- }
- }
- public void setRows(int i) {
- rows = i;
- }
- public void setCols(int i) {
- cols = i;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement