您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)

 

Apply Index

Apply Page # 3

Activity 3 — Understanding the co-ordinate system

(1) Suppose a simple Java program draws a square whose centre is the centre of its window. That is, if the window is 100 pixels wide and 100 pixels high, the centre of the square and of the window is at position x=50, y=50.

If the square is exactly 50 pixels wide and 50 pixels high, what are the co-ordinates of each of its four corners?

You may find it helps to draw the square and the window on paper first.

(2) write an applet to display a red square at these co-ordinates and with a side length of 50.

Discussion of Activity 3
Back to Content

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg