OUM Koleksi Aturcara Software Pangkalan Data Nokia Forum FAQ Email Alileila
Welcome to Alileila OnLine
Advanced Search - Link me to an Advanced Search!
 » Utama » Java
Java Listener & Event Handlers << Back | Home | Next >>


Java applets interactive! We can use inheritance and abstract classes to further the event handling process. This is where the EventObject, which is the parent to the AWTEvent comes into play. Below are some user actions and the event types associated with them:

 

User Action

Event Type

Click a Button

ActionEvent

Click a Component

MouseEvent

Click an item in a Choice

ItemEvent

Click an item in a Checkbox

ItemEvent

Change text in a TextField

TextEvent

Open a window

WindowEvent

Iconify a window

WindowEvent

Type a key

KeyEvent

 

As you may have guessed, every xxxEvent requires an xxxListener, which has the return type void. Remembering that interfaces contain abstract methods, which are empty methods, in order to implement a listener, you must provide your own methods for all the methods that are part of the interface. Although you can leave the methods empty in your implementation. The following table shows the events, their listeners, and their handlers:

 

Event

Listener

Handlers

ActionEvent

ActionListener

actionPerformed(ActionEvent)

ItemEvent

ItemListener

itemStateChanged(ItemEvent)

TextEvent

TextListener

textValueChanged(TextEvent)

AdjustmentEvent

AdjustmentListener

adjustmentValueChanged(AdjustmentEvent)

ContainerEvent

ContainerListener

componentAdded(ContainerEvent)

 

 

componentRemoved(ContainerEvent)

ComponentEvent

ComponentListener

componentMoved(ComponentEvent)

 

 

componentHidden(ComponentEvent)

 

 

componentResized(ComponentEvent)

 

 

componentShown(ComponentEvent)

FocusEvent

FocusListener

focusGained(FocusEvent)

 

 

focusLost(FocusEvent)

MouseEvent

MouseListener

mousePressed(MouseEvent)

 

 

mouseReleased(MouseEvent)

 

 

mouseEntered(MouseEvent)

 

 

mouseExited(MouseEvent)

 

 

mouseClicked(MouseEvent)

 

MouseMotionListener

mouseDragged(MouseEvent)

 

 

mouseMoved(MouseEvent)

KeyEvent

KeyListener

keyPressed(KeyEvent)

 

 

keyTyped(KeyEvent)

 

 

keyReleased(KeyEvent)

WindowEvent

ComponentListener

windowMoved(WindowEvent)

 

 

windowActivated(WindowEvent)

 

 

windowClosing(WindowEvent)

 

 

windowClosed(WindowEvent)

 

 

windowDeiconified(WindowEvent)

 

 

windowIconified(WindowEvent)

 

 

windowOpened(WindowEvent)

 

 Sudut Berita

Quotes Of To Day
-------------------

Life Does
Not Have To
Be Perfect
To Be
Wonderful

-------------------



Pendaftaran Semester September 2004

Selamat mendaftar untuk semester baru! Kepada yang masih belum mendaftar silalah berbuat demikian sebelum 30 Aug ini. Berikut adalah gambar-gambar yang diambil semasa hari pendaftaran pelajar2 lama di mana kami OUMClub juga turut membantu dalam proses pendaftaran pada hari tersebut...


Pendaftaran Siswa/i Baru

Pendaftaran Siswa/i Baru

Pendaftaran Siswa/i Baru

Pendaftaran Siswa/i Baru

Pendaftaran Siswa/i Baru

Pendaftaran Siswa/i Baru

Pendaftaran Siswa/i Baru

Pendaftaran Siswa/i Baru

Pendaftaran Siswa/i Baru



Kepada rakan2 yg ingin berkongsi maklumat, cadangan serta buah fikiran jom berforum di www.oumclub.com

TQ


 

 Test

Hello..!

 
OUM Koleksi Aturcara Software Pangkalan Data Nokia Forum FAQ Email Alileila
©2004 Hak cipta terpelihara. Sebarang unsur peniruan atau percetakkan harus mendapat kebenaran terlebih dahulu.