Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.geom.Ellipse2D;
- import javax.swing.JPanel;
- public class Representation extends JPanel{ // Each Pixel representation
- int x;
- int y;
- int sizex;
- int sizey;
- int width;
- int height;
- Color colorgb;
- Representation(int xx,int yy,int ssizex,int ssizey,Color rgb,int w,int h)
- {
- x=xx;
- y=yy;
- sizex=ssizex;
- sizey=ssizey;
- colorgb = rgb;
- width = w;
- height = h;
- }
- @Override
- public void paint(Graphics g)
- {
- Graphics2D g2d = (Graphics2D) g;
- g2d.setColor(colorgb);
- g2d.fillRect(x,y, sizex, sizey);
- }
- }
Add Comment
Please, Sign In to add comment