Nokia N800/N810如何配置java + SWT
最近在玩Nokia的tablet... N800和N810. 虽然不自带java, 但可以安装一个叫jalimo的冬冬, 使用cacao的java vm. 不过没有swing和awt, 所以要安装swt-gtk的jar.
jalimo的地址这里:
https://wiki.evolvis.org/jalimo/index.php/Main_Page
用你的N800/810去那里的maemo板块https://wiki.evolvis.org/jalimo/index.php/Maemo下载所需要的软件即可.
SWT的就相对简单了, 去eclipse.org那里就有很多samples:
import org.eclipse.swt.SWT;import org.eclipse.swt.layout.RowLayout;import org.eclipse.swt.widgets.*; public class SimpleSwtSample { public static void main(String[] args) { Display display = Display.getDefault(); final Shell shell = new Shell(display); shell.setLayout(new RowLayout(SWT.VERTICAL)); Label label = new Label(shell, SWT.CENTER); label.setText("Hello maemo"); Button button = new Button(shell, SWT.NONE); button.setText("close"); button.addListener(SWT.Selection, new Listener() { public void handleEvent(Event arg0) { shell.dispose(); } }); shell.open(); while (!shell.isDisposed()) if (!display.readAndDispatch()) display.sleep(); }}cacao -cp /usr/share/java/swt-gtk.jar:. SimpleSwtSample