2006/08/21
Linux的SWTプログラミング
gentoo portageのSWTはx86_64で問題がある(org.eclipse.swt.gtk.OS.memmoveがないとおこられる)ようなので http://www.eclipse.org/downloads/ -> Other downloads -> SWT Binary and Source -> Linux (x86_64/GTK-2)をダウンロードして以下のようにインストール。
% su % unzip swt-3.2-gtk-linux-x86_64.zip -d /usr/local/
compile and run a test program.
Test.java:
import org.eclipse.swt.widgets.*; public class Test { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Test Shell"); shell.setSize(200, 200); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
% export CLASSPATH=$CLASSPATH:/usr/local/swt-M20060629-1905-gtk-linux-x86_64/swt.jar % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/swt-M20060629-1905-gtk-linux-x86_64/ % javac Test.java % java Test
You may also be happy to read following useful documents (notably org.eclipse.swt.widgets in official).
- http://help.eclipse.org/help31/nftopic/org.eclipse.platform.doc.isv/reference/api/overview-summary.html
- http://amateras.sourceforge.jp/cgi-bin/fswiki/wiki.cgi/swt?page=FrontPage
Nihongo unatenakunatta. Koredakara GUI application ha iya nanda.
- The URL to Trackback this entry is:
- http://dev.ariel-networks.com/Members/matsuyama/linux7684swt30ed30e930df30f3/tbping