Tải bản đầy đủ (.pptx) (39 trang)

Tìm hiểu về java applets

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (747.69 KB, 39 trang )

JAVA APPLETS


Tổng quan về Applet

Cài đặt một Applet trong trang web

Các thành phần trong AWT.

Giới hạn của Applet



 !"#$%
&%'#(#)*+, /0#1$
/213425/.60#
789,3425: 
 !"#
#;4!<&$%
=>#;4/./?9#2/@%9ABC$.#2"4
AB'=335D##+.E425
javac –encoding utf-8 HelloWorld.java
<>,5F)*1425GHIJK21L6.3,M
$%&"
NOPQ/6,O%E,R
A:$%STF1$/
java.lang.Object
java.awt.Component
java.awt.Container
java.applet.Applet
'(



/UVWXGQS,
)*+",-
K
Vẽ Applet
stop( )
Bắt đầu
start( ) paint( )
Applet đang làm
việc
Applet được sinh
ra
Applet được hiển thị
Applet nghỉ và chờ
Applet bị phá
hủy
Khởi tạo
destroy( )
Hủy
init( )
Dừng
./"01#""123",
=3,YTYZE?#2QF[Q%\/,>%ST
%ST

init() N]QF,%^@/ ZWQ

start()  *_,L,W%.%\@
`#T


stop()  AVT,WQ%%\@,$#+.E

destroy()  ZERaG45QYb
4/"
$%&"
0%ST56/#%ST@,335#

567%ST35S46%\Y@paint() ,343
cY,W+#2#"4

567/%ST@ZEpaint() (/`E
d6C
QP%]Y%ST/.PX8
QeP%]Y%STfZE%click chuột, rê chuột, thảg
#X9hW8
0:8

8iAbstract WindowingToolkitj

&/ 4 % E 1 9 k #+ "; #P %^ @ ,3   Z  E
%\@iGUIj

A V ,L. ,W Y ,D %^ L O ,3 _ l /  2  T 9
";LV

AY/LE,R(#$;<=
./">?",8
.@>!A 


.&/,D%^@,3T,ZY,D%^Y)#P
A

!A /,D%^,%^@,3,f3vị trí /kích
thước WY/L42#,D%^A#

9@7AY/L$3kYZEP/4/?
B@/""/"!A 

*##&.

I;&.

A#&.

m#&.

m#*&.
C!A

BorderLayout/Y_OY/L,%\fWTF
$nZ,335

0Qmop7QqiNOUTHj

0Qmopo)riSOUTHj

&s)op7QqiWESTj

&s)opo)riEASTj


Ao)oqiCENTERj
=!A

= /.>,5QF,S6/,>Y/L#2@eP
#Y6Ff/1,W+,D%^tOC,%^,>]/%XAY
f>,5/canh giữa

A$3,>TPP#Y6.%^4(%ST
setComponentOrientaon
.!A

AY,D%^,%^,>P>XT/(2%Y
Y4/)%k.:V.,%^,D%^AY,D%^Y(42
%XC45V
D!A

%X1+XY14(AY,D%^C,>PY1
,$TZ_Oh/P#Yd6FP#2D
DC!A

= /Y#+4/..3.3uhc 3LVAY,D%^#
Th,%^,%/%X%SZm#&.%?%XY
,D%^1VO6P?Z#2@.RGridBagConstraint
./"E2>AF5G!!!A6

NY9Y#+4/./.F6/V64(.PE,55#?R,?
Y#2/+,D%^

=3Y9Y#+4/./.@

setLayout(null)

AY/%\@
public void setLocation(Point p)
public void setSize(Dimension d)
public void setBounds(Rectangle r)
./"01#""
rLOY/L,f,%^UVPX/component2B,f$
u%ST,%^OOvPXcomponentr%X, /Y%S
public void setBackground(Color c)=>/f
public Color getBackground(Color c)&V./f
public void setForeground(Color c)=>/u
public Color getForeground(Color c)&V./u
public void setVisible(boolean isShowed)wE,D%^
./"01#""
public void setFont(Font f).,Mx35Y,D%^iTextField, TextArea, Bu#on,
CheckboxFgj
public Font getFont()&V.yxW,D%^
public FontMetrics getFontMetrics(Font f): &V.1tf?%XW,D%^x,,%^
89
public Component getComponentAt(Point P): +,D%^]R,iF.j#T
A#
public void setEnabled(): z4k{>z_{
public void repaint(): kk
public void update(Graphics g): ,%^Rd#ij
./"@F4:"
AY|D.YZEVYPXA,L/uZE
public void addComponentListener(ComponentListener l)
}8'YZE,D%^.,Mf?%XFE#.G,%%ST~4ij
public void addFocusListener(FocusListener l)

public void addKeyListener(KeyListener l)
public void addMouseListener(MouseListener l)
public void addMouseMotionListener(MouseMotionListener l)

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×