Skip to content

Commit add81f9

Browse files
authored
Create painting.java
1 parent a6dc605 commit add81f9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

painting.java

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import java.awt.*;
2+
import java.awt.event.*;
3+
import java.applet.*;
4+
public class MouseDrag extends Applet implements MouseMotionListener{
5+
6+
public void init(){
7+
addMouseMotionListener(this);
8+
setBackground(Color.red);
9+
}
10+
11+
public void mouseDragged(MouseEvent me){
12+
Graphics g=getGraphics();
13+
g.setColor(Color.white);
14+
g.fillOval(me.getX(),me.getY(),5,5);
15+
}
16+
public void mouseMoved(MouseEvent me){}
17+
18+
}

0 commit comments

Comments
 (0)