jil*_*len 2 java eclipse layout swt scala
package org.jilen.editor
import org.eclipse.swt.widgets.Display
import org.eclipse.swt.widgets.Shell
import org.eclipse.swt.widgets.Text
import org.eclipse.swt.SWT
object EditorApp {
def main(args: Array[String]) {
val display = new Display()
val shell = new Shell(display)
val text = new Text(shell, SWT.CENTER)
text.setText("Hello SWT")
shell.pack()
shell.open()
while (!shell.isDisposed) {
if (!display.readAndDispatch) {
display.sleep()
}
}
display.dispose()
}
}
Run Code Online (Sandbox Code Playgroud)
非常简单的代码,但没有显示文本.
窗口中间应该有"hello swt".
scala.version = 2.9.0-1,swt:3.7.0-win32

| 归档时间: |
|
| 查看次数: |
1254 次 |
| 最近记录: |