thanassis.com
home
blog
Online Games
Sudoku
Ivory Tower
Web Hangman
Software
Java
Object Oriented
Mobiles / J2ME
Research
C.S. Resources
Galleries
Greece
Music
Photography
Art
Personal
About me
Useful Links
Contact
Site
Downloads
My other sites
Thanassis.gr
Djangopedia
Kilogames
Xoocle
TrainJava
GameAnatomy
Latest News
Canvas Example
import java.awt.*;
import java.awt.event.*;
public class GridPenCanvas extends Canvas implements MouseListener, MouseMotionListener{
int old_mouse_x = 0; // old position (x,y) for mouse drawing
int old_mouse_y = 0;
int horizontal_spacing = 0; // pixels between rows and columns,
int vertical_spacing = 0;
public GridPenCanvas(int horiz_spacing, int vert_spacing) {
horizontal_spacing = horiz_spacing;
vertical_spacing = vert_spacing;
}
Previous slide
Next slide
Back to first slide
View graphic version
Web
this site
Thanassis Blog News
In the News
Deep impact smashes comet
3 Florida shark attacks in a week
Mad Cow
summit in Scotland
Search the Archives