⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 button.scala

📁 JAVA 语言的函数式编程扩展
💻 SCALA
字号:
package scala.swingimport javax.swing._import event._/** A class for buttons; standard constructor wraps around a swing button */class Button(override val peer: JButton) extends Component with Publisher {  def this(txt: String) = this(new JButton(txt))  def this() = this(new JButton)  def text: String = peer.getText  def text_=(s: String) = peer.setText(s)  def icon: Icon = peer.getIcon  def icon_=(i: Icon) = peer.setIcon(i)  peer.addActionListener {    new java.awt.event.ActionListener {      def actionPerformed(e: java.awt.event.ActionEvent) {        publish(ButtonPressed(Button.this))      }    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -