Một số biến cố và phương thức xử lý (tiếp)

Một phần của tài liệu bài giảng tương tác người máy tổng quan về hci, tâm lý nhận thức của con người trong giao tiếp và xử lý (Trang 35 - 42)

- Ngoài hai thành phần trờn thỡ Swing cũn chứa cỏcthànhphầnkhỏcnhưsau

Một số biến cố và phương thức xử lý (tiếp)

(tiếp)

3- WindowEvent

+ Nguyờn nhõn: Mở, đúng, thu nhỏ thành biểu tượng

+ Giao diện lắng nghe: WindowListener

+ Phương thức xử lý:

i)window Closing(WindowEvent e) ii)windowOpened(WindowEvent e) ii)windowOpened(WindowEvent e) iii)windowIconified(WindowEvent e) iv)windowDeiconified(WindowEvent e) v)windowClosed(WindowEvent e)

Một số biến cố phương thức xử (tiếp) (tiếp)

vii)windowDeactivated(WindowEvent e)

4- ContainerEvent

+ Nguyờn nhõn: Bổ sung hoặc loại bỏ thành phần khỏi vật chứa

+ Giao diện lắng nghe: ContainerListener

+ Phương thức xử lý :

i)componentAdded(ContainerEvent e) ii)componentRemoved(ContainerEvent e)

Một số biến cố phương thức xử (tiếp) (tiếp)

5- ComponentEvent

+ Nguyờn nhõn: Di chuyển, định kớch cỡ, dấu hoặc hiện lại Component

+ Giao diện lắng nghe: ComponentListener

+ Phương thức xử lý :

i)componentMoved(ComponentEvent e)

ii)componentHidden(ComponentEvent e)

iii)componentResized(ComponentEvent e)

Một số biến cố phương thức xử (tiếp) (tiếp)

6- FocusEvent (mở rộng gúi java.awt.ComponentEvent)+ Nguyờn nhõn: Dời tiờu điểm đến/ ra khỏi thành phần : + Nguyờn nhõn: Dời tiờu điểm đến/ ra khỏi thành phần :

Component

+ Giao diện lắng nghe : FocusListener

+ Phương thức xử lý :

i)focusGained(FocusEvent e) ii)focusLost(FocusEvent e) ii)focusLost(FocusEvent e)

7- TextEvent

+ Nguyờn nhõn:Thay đổi văn bản(JtextComponent) + Giao diện lắng nghe : TextListener

Một số biến cố phương thức xử (tiếp) (tiếp)

+ Phương thức xử lý : textValueChanged(TextEvent e)

8- KeyEvent

+ Nguyờn nhõn: Thả hoặc nhấn phớm Component

+ Giao diện lắng nghe : KeyListener

+ Phương thức xử lý :

i) KeyPressed(KeyEvent e)

ii) KeyReleased(KeyEvent e) iii)KeyTyped(KeyEvent e)

9- MouseEvent

Một số biến cố phương thức xử (tiếp) (tiếp)

+ Giao diện lắng nghe: cú hai giao diện lắng nghe MouseListener MouseMotionListener

+ Phương thức xử lý. - Với MouseListener :

i) MousePressed(MouseEvent e) ii) MouseReleased(MouseEvent e) ii) MouseReleased(MouseEvent e) iii) MouseEntered(MouseEvent e) iv)MouseExited(MouseEvent e) v)MouseClicked(MouseEvent e) -Với MouseMotionListener :

Một số biến cố phương thức xử (tiếp) (tiếp)

ii) MouseMoved(MouseEvent e)

10- AdjustmentEvent

+ Nguyờn nhõn: Di chuyển thanh cuốn JscrollBar

+ Giao diện lắng nghe : AdjustmentListener

+ Phương thức xử lý :

adjustmentValueChanged(AdjustmentEvent e)

11- ListSelectionEvent

+ Nguyờn nhõn: Chọn khoản mục: Jlist

+ Giao diện lắng nghe: ListSelectionListener

+ Phương thức xử lý :

Một phần của tài liệu bài giảng tương tác người máy tổng quan về hci, tâm lý nhận thức của con người trong giao tiếp và xử lý (Trang 35 - 42)