Java Swing O Reilly Add and (Web site templates) remove a

Java Swing O Reilly Add and remove a VetoableChangeListener to the event registration list. A VetoableChangeListener is allowed to veto any property changes that occur inside a component. If only one veto occurs, the property is not changed. public void addAncestorListener(AncestorListener listener) public void removeAncestorListener(AncestorListener listener) Add and remove an AncestorListener to the event registration list. All registered objects are notified if any of the components’ ancestors change position or are made visible or invisible. JComponent also inherits all the event listener registration methods from its AWT superclasses, Container and Component. From Component, it inherits the methods to add or remove a ComponentListener, FocusListener, KeyListener, MouseListener, or MouseMotionListener. From Container, it inherits the methods to add or remove a ContainerListener. We won’t describe all the listener interfaces here; for more information, see Java AWT by John Zukowski (O’Reilly). However, you should note that Swing only supports the JDK 1.1 event model. To receive an event, you always must register as a listener with the JComponent that generates the event events are never propagated through the containment hierarchy, as they were with JDK 1.0. 3.3.4 Fields and Methods 3.3.4.1 Protected Fields protected AccessibleContext accessibleContext Holds the AccessibleContext for the component. protected EventListenerList listenerList The event listener list for the component. See Chapter 27 for more information on the EventListenerList class. protected ComponentUI ui The UI delegate for the component. 3.3.4.2 Constructor public JComponent() Initializes a simple JComponent and sets the layout manager to null. 3.3.4.3 Graphics protected Graphics getComponentGraphics(Graphics g) Accepts a graphics context and modifies its foreground color and font to match the current defaults. If the debug graphics option has been activated, the method returns a special graphics object that the programmer can configure for debugging component drawing with the color and font modifications. public void update(Graphics g) - 69 -
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

Leave a Reply