Showing posts with label eventHandling. Show all posts
Showing posts with label eventHandling. Show all posts

Friday, 21 February 2014

EVENT CLASSES:The ItemEvent Class

an item was selected or deselected....


ItemEvent class:

A semantic event which indicates that an item was selected or deselected.Defines the itemStateChanged() method when an item has been selected or deselected by the user. The event is passed to every ItemListener object which registered to receive such events using the component's addItemListener method.

The stateChange of any ItemEvent instance takes one of the following values:


  • DESELECTED:   The user deselected an item

           syntax:
             ItemEvent.DESELECTED


  • SELECTED: The user selected an item.

            syntax:
                 ItemEvent.SELECTED

Wednesday, 5 February 2014

Event classes:The FocusEvent Class

 FocusEvent :gains or loses input focus.......

The FocusEvent Class


         A FocusEvent is generated when a component gains or loses input focus. 


Integer constants :

  • FOCUS_GAINED 
  • FOCUS_LOST

 FocusEvent Constructor:

FocusEvent is a subclass of ComponentEvent and has these constructors:


  • FocusEvent(Componentsrc, int type)
  • FocusEvent(Componentsrc, int type, boolean temporaryFlag)
  • FocusEvent(Componentsrc, int type, boolean temporaryFlag, Component other)

Monday, 3 February 2014

EVENT CLASSES:The InputEvent Class

The abstract class InputEvent is a subclass of ComponentEvent...........

The InputEvent Class

The abstract class InputEvent is a subclass of ComponentEvent and is the superclass for component input events. Its subclasses are KeyEvent andMouseEvent.InputEvent defines several integer constants that represent any modifiers, such as the control key being pressed, that might be associated with the event.

The InputEvent class defined the following eight values to represent the modifiers:

ALT_MASK 
ALT_GRAPH_MASK 
BUTTON2_MASK 
BUTTON3_MASK 
BUTTON1_MASK 
CTRL_MASK
META_MASK
SHIFT_MASK