scala.swing

Button

class Button extends AbstractButton with Publisher

A button that can be clicked, usually to perform some action.

Inherits

  1. AbstractButton
  2. Trigger
  3. Component
  4. UIElement
  5. LazyPublisher
  6. Publisher
  7. Reactor
  8. Proxy
  9. AnyRef
  10. Any

Value Members

  1. var Mouse: mouse

  2. def action: Action

  3. def action_=(a: Action): Unit

  4. def background: Color

  5. def background_=(c: Color): Unit

  6. def border: Border

  7. def borderPainted: Boolean

  8. def borderPainted_=(b: Boolean): Unit

  9. def border_=(b: Border): Unit

  10. def bounds: Rectangle

  11. def contentAreaFilled: Boolean

  12. def contentAreaFilled_=(b: Boolean): Unit

  13. def cursor: Cursor

  14. def cursor_=(c: Cursor): Unit

  15. 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.

    definition classes: Reactor
  16. def defaultButton: Boolean

  17. def defaultCapable: Boolean

  18. def defaultCapable_=(capable: Boolean): Unit

  19. def disabledIcon: Icon

  20. def disabledIcon_=(i: Icon): Unit

  21. def disabledSelectedIcon: Icon

  22. def disabledSelectedIcon_=(i: Icon): Unit

  23. def displayable: Boolean

  24. def displayedMnemonicIndex: Int

  25. def displayedMnemonicIndex_=(n: Int): Unit

  26. def doClick(times: Int): Unit

  27. def doClick(): Unit

  28. def enabled: Boolean

  29. def enabled_=(b: Boolean): Unit

  30. def equals(that: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    The default implementations of this method is an equivalence relation:

    • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
    • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
    • It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects that are "equal" (o1.equals(o2) returns true) hash to the same Int (o1.hashCode.equals(o2.hashCode)).

    definition classes: Proxy ⇐ AnyRef ⇐ Any
  31. def focusPainted: Boolean

  32. def focusPainted_=(b: Boolean): Unit

  33. def focusable: Boolean

  34. def focusable_=(b: Boolean): Unit

  35. def font: Font

  36. def font_=(f: Font): Unit

  37. def foreground: Color

  38. def foreground_=(c: Color): Unit

  39. def hasFocus: Boolean

  40. def hashCode(): Int

    Returns a hash code value for the object

    Returns a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    definition classes: Proxy ⇐ AnyRef ⇐ Any
  41. def horizontalAlignment: Value

  42. def horizontalAlignment_=(a: Value): Unit

  43. def horizontalTextPosition: Value

  44. def horizontalTextPosition_=(a: Value): Unit

  45. def icon: Icon

  46. def iconTextGap: Int

  47. def iconTextGap_=(x: Int): Unit

  48. def icon_=(i: Icon): Unit

  49. def ignoreRepaint: Boolean

  50. def ignoreRepaint_=(b: Boolean): Unit

  51. var initP: JComponent

  52. def inputVerifier: (Button.this.type) ⇒ Boolean

  53. def inputVerifier_=(v: (Button.this.type) ⇒ Boolean): Unit

  54. object keys extends Publisher

  55. 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.

    definition classes: Reactor
  56. def locale: Locale

  57. def location: Point

  58. def locationOnScreen: Point

  59. def margin: Insets

  60. def margin_=(i: Insets): Unit

  61. def maximumSize: Dimension

  62. def maximumSize_=(x: Dimension): Unit

  63. def minimumSize: Dimension

  64. def minimumSize_=(x: Dimension): Unit

  65. def mnemonic: Value

  66. def mnemonic_=(k: Value): Unit

  67. object mouse extends AnyRef

    Contains publishers for various mouse events

  68. def multiClickThreshold: Long

  69. def multiClickThreshold_=(n: Long): Unit

  70. def onFirstSubscribe(): Unit

  71. def onLastUnsubscribe(): Unit

  72. def opaque: Boolean

  73. def opaque_=(b: Boolean): Unit

  74. def paint(g: Graphics2D): Unit

  75. var peer: JButton

    The underlying Swing peer

    The underlying Swing peer.

  76. def preferredSize: Dimension

  77. def preferredSize_=(xy: (Int, Int)): Unit

  78. def preferredSize_=(x: Dimension): Unit

  79. def pressedIcon: Icon

  80. def pressedIcon_=(i: Icon): Unit

  81. def publish(e: Event): Unit

    Notify all registered reactions

    Notify all registered reactions.

    definition classes: Publisher
  82. val reactions: Reactions

    All reactions of this reactor

    All reactions of this reactor.

    definition classes: Reactor
  83. def repaint(rect: Rectangle): Unit

  84. def repaint(): Unit

  85. def requestFocus(): Unit

  86. def requestFocusInWindow(): Boolean

  87. def revalidate(): Unit

  88. def rolloverEnabled: Boolean

  89. def rolloverEnabled_=(b: Boolean): Unit

  90. def rolloverIcon: Icon

  91. def rolloverIcon_=(b: Icon): Unit

  92. def rolloverSelectedIcon: Icon

  93. def rolloverSelectedIcon_=(b: Icon): Unit

  94. def selected: Boolean

  95. def selectedIcon: Icon

  96. def selectedIcon_=(i: Icon): Unit

  97. def selected_=(b: Boolean): Unit

  98. def self: Component

  99. def showing: Boolean

  100. def size: Dimension

  101. def size_=(xy: (Int, Int)): Unit

  102. def size_=(dim: Dimension): Unit

  103. def subscribe(listener: PartialFunction[Event, Unit]): Unit

  104. def text: String

  105. def text_=(s: String): Unit

  106. def toString(): String

    Returns a string representation of the object

    Returns a string representation of the object.

    The default representation is platform dependent.

    definition classes: ComponentProxy ⇐ AnyRef ⇐ Any
  107. def toolkit: Toolkit

  108. def tooltip: String

  109. def tooltip_=(t: String): Unit

  110. def unsubscribe(listener: PartialFunction[Event, Unit]): Unit

  111. def verticalAlignment: Value

  112. def verticalAlignment_=(a: Value): Unit

  113. def verticalTextPosition: Value

  114. def verticalTextPosition_=(a: Value): Unit

  115. def visible: Boolean

  116. def visible_=(b: Boolean): Unit

  117. def xLayoutAlignment: Double

    Used by certain layout managers, e

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

    definition classes: Component
  118. def xLayoutAlignment_=(x: Double): Unit

  119. def yLayoutAlignment: Double

  120. def yLayoutAlignment_=(y: Double): Unit

Instance constructors

  1. new Button(a: Action)

  2. new Button()

  3. new Button(text0: String)