| new Rectangle() | ใช้สร้าง object rectangle และเก็บค่าแกน x, y และขนาดความกว้าง ความสูง ไว้ที่ 0 ทั้งหมด |
|---|---|
| new Rectangle( object_dimension ) | ใช้สร้าง object rectangle และเก็บค่าแกน x, y ที่ 0, 0 และเก็บค่า ขนาดความกว้าง ความสูง ตามที่ object dimension เก็บไว้ |
| new Rectangle( weight, height ) | ใช้สร้าง object rectangle และเก็บค่าแกน x, y ที่ 0, 0 โดยเก็บค่า ขนาดความกว้าง และความสูง ตามที่กำหนด |
| new Rectangle( x, y, weight, height ) | ใช้สร้าง object rectangle และเก็บค่าแกน x, y และขนาดความกว้าง ความสูง ตามที่กำหนด |
| x | ใช้คืนค่า แกน x |
| y | ใช้คืนค่า แกน y |
| width | ใช้คืนค่า ความกว้าง |
| height | ใช้คืนค่า ความสูง |
method:new Rectangle ();
return type:Rectangle
content:ใช้สร้าง object rectangle และเก็บค่าแกน x, y และขนาดความกว้าง ความสูง ไว้ที่ 0 ทั้งหมด
example:Rectangle rect = new Rectangle ();
method:new Rectangle ( object_dimension );
return type:Rectangle
content:ใช้สร้าง object rectangle และเก็บค่าแกน x, y ที่ 0, 0 และเก็บค่า ขนาดความกว้าง ความสูง ตามที่ object dimension เก็บไว้
example:Dimension dimension = new Dimension ( 300, 300 ); Rectangle rect = new Rectangle ( dimension );
method:new Rectangle ( weight, height );
return type:Rectangle
content:ใช้สร้าง object rectangle และเก็บค่าแกน x, y ที่ 0, 0 โดยเก็บค่า ขนาดความกว้าง และความสูง ตามที่กำหนด
example:Rectangle rect = new Rectangle ( 300, 300 );
method:new Rectangle ( x, y, weight, height );
return type:Rectangle
content:ใช้สร้าง object rectangle และเก็บค่าแกน x, y และขนาดความกว้าง ความสูง ตามที่กำหนด
example:Rectangle rect = new Rectangle ( 10, 10, 300, 300 );
property:x;
return type:double
content:ใช้คืนค่า แกน x
example:Rectangle rect = new Rectangle ( 10, 10, 300, 300 ); double screen_x = rect.x;
property:y;
return type:double
content:ใช้คืนค่า แกน y
example:Rectangle rect = new Rectangle ( 10, 10, 300, 300 ); double screen_y = rect.y;
property:width;
return type:double
content:ใช้คืนค่า ความกว้าง
example:Rectangle rect = new Rectangle ( 10, 10, 300, 300 ); double screen_width = rect.width;
property:height;
return type:double
content:ใช้คืนค่า ความสูง
example:Rectangle rect = new Rectangle ( 10, 10, 300, 300 ); double screen_height = rect.height;