scala.swing

ToggleButton

class ToggleButton extends AbstractButton

A two state button with a push button like user interface. Usually used in tool bars.

known subclasses: RadioButton, CheckBox

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 disabledIcon: Icon

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

  18. def disabledSelectedIcon: Icon

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

  20. def displayable: Boolean

  21. def displayedMnemonicIndex: Int

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

  23. def doClick(times: Int): Unit

  24. def doClick(): Unit

  25. def enabled: Boolean

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

  27. 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
  28. def focusPainted: Boolean

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

  30. def focusable: Boolean

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

  32. def font: Font

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

  34. def foreground: Color

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

  36. def hasFocus: Boolean

  37. 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
  38. def horizontalAlignment: Value

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

  40. def horizontalTextPosition: Value

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

  42. def icon: Icon

  43. def iconTextGap: Int

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

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

  46. def ignoreRepaint: Boolean

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

  48. var initP: JComponent

  49. def inputVerifier: (ToggleButton.this.type) ⇒ Boolean

  50. def inputVerifier_=(v: (ToggleButton.this.type) ⇒ Boolean): Unit

  51. object keys extends Publisher

  52. 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
  53. def locale: Locale

  54. def location: Point

  55. def locationOnScreen: Point

  56. def margin: Insets

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

  58. def maximumSize: Dimension

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

  60. def minimumSize: Dimension

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

  62. def mnemonic: Value

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

  64. object mouse extends AnyRef

    Contains publishers for various mouse events

  65. def multiClickThreshold: Long

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

  67. def onFirstSubscribe(): Unit

  68. def onLastUnsubscribe(): Unit

  69. def opaque: Boolean

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

  71. def paint(g: Graphics2D): Unit

  72. var peer: JToggleButton

    The underlying Swing peer

    The underlying Swing peer.

  73. def preferredSize: Dimension

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

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

  76. def pressedIcon: Icon

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

  78. def publish(e: Event): Unit

    Notify all registered reactions

    Notify all registered reactions.

    definition classes: Publisher
  79. val reactions: Reactions

    All reactions of this reactor

    All reactions of this reactor.

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

  81. def repaint(): Unit

  82. def requestFocus(): Unit

  83. def requestFocusInWindow(): Boolean

  84. def revalidate(): Unit

  85. def rolloverEnabled: Boolean

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

  87. def rolloverIcon: Icon

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

  89. def rolloverSelectedIcon: Icon

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

  91. def selected: Boolean

  92. def selectedIcon: Icon

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

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

  95. def self: Component

  96. def showing: Boolean

  97. def size: Dimension

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

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

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

  101. def text: String

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

  103. 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
  104. def toolkit: Toolkit

  105. def tooltip: String

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

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

  108. def verticalAlignment: Value

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

  110. def verticalTextPosition: Value

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

  112. def visible: Boolean

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

  114. 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
  115. def xLayoutAlignment_=(x: Double): Unit

  116. def yLayoutAlignment: Double

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

Instance constructors

  1. new ToggleButton()

  2. new ToggleButton(text0: String)