| new Font() | ใช้สร้าง object font |
|---|---|
| getName() | ใช้คืนค่า ประเภท ของ font |
| getSize() | ใช้คืนค่า ขนาด ของ font |
| getStyle() | ใช้คืนค่า รูปแบบ ของ font |
| getFamily() | ใช้คืนค่า ชื่อตระกูล ของ font |
| isBold() | ใช้ตรวจสอบว่า font เป็นแบบ BOLD ใช่หรือไม่ |
| isItalic() | ใช้ตรวจสอบว่า font เป็นแบบ ITALICS ใช่หรือไม่ |
| isPlain() | ใช้ตรวจสอบว่า font เป็นแบบ PLAIN ใช่หรือไม่ |
| PLAIN | ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น ตัวอักษรแบบธรรมดา |
| BOLD | ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น ตัวอักษรแบบตัวหนา |
| ITALICS | ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น ตัวอักษรแบบตัวเอียง |
method:new Font ( type, style, size );
return type:Font
content:ใช้สร้าง object font
example:Font font = new Font ( "TimesRoman", Font.BOLD, 12 );
method:getName ();
return type:String
content:ใช้คืนค่า ประเภท ของ font
example:Font font = new Font ( "TimesRoman", Font.BOLD, 12 ); System.out.println ( font.getName() );
method:getSize ();
return type:int
content:ใช้คืนค่า ขนาด ของ font
example:Font font = new Font ( "TimesRoman", Font.BOLD, 12 ); int size = font.getSize ();
method:getStyle ();
return type:int
content:ใช้คืนค่า รูปแบบ ของ font
example:Font font = new Font ( "TimesRoman", Font.BOLD, 12 ); int style = font.getStyle ();
method:getFamily ();
return type:String
content:ใช้คืนค่า ชื่อตระกูล ของ font
example:Font font = new Font ( "TimesRoman", Font.BOLD, 12 ); System.out.println ( font.getFamily() );
method:isBold ();
return type:boolean
content:ใช้ตรวจสอบว่า font เป็นแบบ BOLD ใช่หรือไม่
example:Font font = new Font ( "TimesRoman", Font.BOLD, 12 ); if ( font.isBold () ) { System.out.println ( "Font is bold." ); }
method:isItalic ();
return type:boolean
content:ใช้ตรวจสอบว่า font เป็นแบบ ITALICS ใช่หรือไม่
example:Font font = new Font ( "TimesRoman", Font.ITALIC, 12 ); if ( font.isItalic () ) { System.out.println ( "Font is italics." ); }
method:isPlain ();
return type:boolean
content:ใช้ตรวจสอบว่า font เป็นแบบ PLAIN ใช่หรือไม่
example:Font font = new Font ( "TimesRoman", Font.PLAIN, 12 ); if ( font.isPlain () ) { System.out.println ( "Font is plain." ); }
property:PLAIN;
return type:int
content:ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น ตัวอักษรแบบธรรมดา
example:Font font = new Font ( "TimesRoman", Font.PLAIN, 12 );
special:static
property:BOLD;
return type:int
special:static
content:ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น ตัวอักษรแบบตัวหนา
example:Font font = new Font ( "TimesRoman", Font.BOLD, 12 );
property:ITALICS;
return type:int
special:static
content:ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น ตัวอักษรแบบตัวเอียง
example:Font font = new Font ( "TimesRoman", Font.ITALICS + Font.BOLD, 12 );