Component

abstract class Component extends UIElement with PeerContainer

Base class for all UI elements that can be displayed in a window. Components are publishers that fire the following event classes: ComponentEvent, FocusEvent, FontChanged, ForegroundChanged, BackgroundChanged.

Base class for all UI elements that can be displayed in a window. Components are publishers that fire the following event classes: ComponentEvent, FocusEvent, FontChanged, ForegroundChanged, BackgroundChanged.

See also

javax.swing.JComponent

http://java.sun.com/products/jfc/tsc/articles/painting/ for the component painting mechanism

Note

[Java Swing] Unlike in Java Swing, not all components are also containers.

Companion
object
trait PeerContainer
trait UIElement
trait LazyPublisher
trait Publisher
trait Reactor
trait Proxy
class Object
trait Matchable
class Any

Type members

Classlikes

object keys extends Publisher
object mouse

Contains publishers for various mouse events. They are separated for efficiency reasons.

Contains publishers for various mouse events. They are separated for efficiency reasons.

Value members

Concrete methods

def border: Border
def border_=(b: Border): Unit
def enabled: Boolean
def enabled_=(b: Boolean): Unit
def focusable: Boolean
def focusable_=(b: Boolean): Unit
def hasFocus: Boolean
def inputVerifier: Component => Boolean
def inputVerifier_=(v: Component => Boolean): Unit
def name: String
def name_=(s: String): Unit
def opaque: Boolean
def opaque_=(b: Boolean): Unit
def paint(g: Graphics2D): Unit
def requestFocus(): Unit
def requestFocusInWindow(): Boolean
def revalidate(): Unit
override def toString: String
Definition Classes
Proxy -> Any
def tooltip: String
def tooltip_=(t: String): Unit
def xLayoutAlignment: Double

Used by certain layout managers, e.g., BoxLayout or OverlayLayout to align components relative to each other.

Used by certain layout managers, e.g., BoxLayout or OverlayLayout to align components relative to each other.

def xLayoutAlignment_=(x: Double): Unit
def yLayoutAlignment: Double
def yLayoutAlignment_=(y: Double): Unit

Inherited methods

Inherited from
UIElement
def background_=(c: Color): Unit
Inherited from
UIElement
Inherited from
UIElement
def componentOrientation: ComponentOrientation
Inherited from
UIElement
def componentOrientation_=(x: ComponentOrientation): Unit
Inherited from
UIElement
def cursor: Cursor
Inherited from
UIElement
def cursor_=(c: Cursor): Unit
Inherited from
UIElement
def deafTo(ps: Publisher*): Unit

Installed reaction won't receive events from the given publisher anylonger.

Installed reaction won't receive events from the given publisher anylonger.

Inherited from
Reactor
def displayable: Boolean
Inherited from
UIElement
override def equals(that: Any): Boolean
Definition Classes
Proxy -> Any
Inherited from
Proxy
def font: Font
Inherited from
UIElement
def font_=(f: Font): Unit
Inherited from
UIElement
Inherited from
UIElement
def foreground_=(c: Color): Unit
Inherited from
UIElement
override def hashCode(): Int
Definition Classes
Proxy -> Any
Inherited from
Proxy
def ignoreRepaint: Boolean
Inherited from
UIElement
def ignoreRepaint_=(b: Boolean): Unit
Inherited from
UIElement
def listenTo(ps: Publisher*): Unit

Listen to the given publisher as long as deafTo isn't called for them.

Listen to the given publisher as long as deafTo isn't called for them.

Inherited from
Reactor
def locale: Locale
Inherited from
UIElement
Inherited from
UIElement
Inherited from
UIElement
Inherited from
UIElement
def maximumSize_=(x: Dimension): Unit
Inherited from
UIElement
Inherited from
UIElement
def minimumSize_=(x: Dimension): Unit
Inherited from
UIElement
Inherited from
UIElement
def preferredSize_=(x: Dimension): Unit
Inherited from
UIElement
def publish(e: Event): Unit

Notify all registered reactions.

Notify all registered reactions.

Inherited from
Publisher
def repaint(rect: Rectangle): Unit
Inherited from
UIElement
def repaint(): Unit
Inherited from
UIElement
def self: Any
Inherited from
UIElement
def showing: Boolean
Inherited from
UIElement
Inherited from
UIElement
override def subscribe(listener: Reaction): Unit
Definition Classes
LazyPublisher -> Publisher
Inherited from
LazyPublisher
def toolkit: Toolkit
Inherited from
UIElement
override def unsubscribe(listener: Reaction): Unit
Definition Classes
LazyPublisher -> Publisher
Inherited from
LazyPublisher
def validate(): Unit
Inherited from
UIElement
def visible: Boolean
Inherited from
UIElement
def visible_=(b: Boolean): Unit
Inherited from
UIElement

Concrete fields

lazy override val peer: JComponent

Inherited fields

protected val listeners: RefSet[Reaction]
Inherited from
Publisher

All reactions of this reactor.

All reactions of this reactor.

Inherited from
Reactor