public class

CompositionArea

extends JPanel
implements InputMethodListener
java.lang.Object
   ↳ java.awt.Component
     ↳ java.awt.Container
       ↳ javax.swing.JComponent
         ↳ javax.swing.JPanel
           ↳ sun.awt.im.CompositionArea

Class Overview

A composition area is used to display text that's being composed using an input method in its own user interface environment, typically in a root window.

Summary

[Expand]
Inherited Constants
From class javax.swing.JComponent
From class java.awt.Component
From interface java.awt.image.ImageObserver
[Expand]
Inherited Fields
From class javax.swing.JComponent
Public Methods
void caretPositionChanged(InputMethodEvent event)
Invoked when the caret within composed text has changed.
InputMethodRequests getInputMethodRequests()
Gets the input method request handler which supports requests from input methods for this component.
void inputMethodTextChanged(InputMethodEvent event)
Invoked when the text entered through an input method has changed.
void paint(Graphics g)
Invoked by Swing to draw components.
[Expand]
Inherited Methods
From class javax.swing.JPanel
From class javax.swing.JComponent
From class java.awt.Container
From class java.awt.Component
From class java.lang.Object
From interface java.awt.MenuContainer
From interface java.awt.event.InputMethodListener
From interface java.awt.image.ImageObserver
From interface javax.accessibility.Accessible

Public Methods

public void caretPositionChanged (InputMethodEvent event)

Invoked when the caret within composed text has changed.

public InputMethodRequests getInputMethodRequests ()

Gets the input method request handler which supports requests from input methods for this component. A component that supports on-the-spot text input must override this method to return an InputMethodRequests instance. At the same time, it also has to handle input method events.

Returns
  • the input method request handler for this component, null by default

public void inputMethodTextChanged (InputMethodEvent event)

Invoked when the text entered through an input method has changed.

public void paint (Graphics g)

Invoked by Swing to draw components. Applications should not invoke paint directly, but should instead use the repaint method to schedule the component for redrawing.

This method actually delegates the work of painting to three protected methods: paintComponent, paintBorder, and paintChildren. They're called in the order listed to ensure that children appear on top of component itself. Generally speaking, the component and its children should not paint in the insets area allocated to the border. Subclasses can just override this method, as always. A subclass that just wants to specialize the UI (look and feel) delegate's paint method should just override paintComponent.

Parameters
g the Graphics context in which to paint