Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package objectoriented;
- import java.awt.*;
- import javax.swing.*;
- /**
- *
- * @author AMRoche
- */
- public class PointScrib extends Scribble {
- //JFrame frame = new JFrame("Line Graphing.");
- int x ;
- static int wide ;
- static int high ;
- public PointScrib(int range, int width, int height) {
- x = range;
- wide = width;
- high = height;
- }
- public void paintComponent (Graphics g) {
- g.setColor(Color.BLACK);
- g.fillRect(0, 0, wide, high);
- for (int i = 0; i < x; i++) {
- Color lol = new Color((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random() * 255),(int) (Math.random() * 255) );
- g.setColor(lol);
- g.fillOval((int) ((wide - 1) * Math.random()), (int) ((high-1) * Math.random()), 2,2);
- }
- }
- public static void main(String[] args) {
- }
- }
Add Comment
Please, Sign In to add comment