Created
September 13, 2011 00:11
-
-
Save Swind/1212840 to your computer and use it in GitHub Desktop.
[Scala][SWT][GUI] SWT使用WebKit核心的範例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.swt | |
import org.eclipse.swt.widgets.{Shell, Display} | |
import org.eclipse.swt.layout.FillLayout | |
import org.eclipse.swt.browser.Browser | |
import org.eclipse.swt.SWT | |
/** | |
* Date: 2011/9/2 | |
* Time: 上午 8:20 | |
*/ | |
object WebKitInABrowser { | |
def main(args: Array[String]) { | |
val display = new Display | |
val shell = new Shell(display) | |
shell setLayout(new FillLayout) | |
shell setText "WebKit" | |
val browser = new Browser(shell,SWT.NONE) | |
shell open() | |
browser.setUrl("http://webkit.org") | |
while(!shell.isDisposed){ | |
if(!display.readAndDispatch()) | |
display.sleep() | |
} | |
display.dispose() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment