Personal tools
You are here: Home ブログ matsuyama Linux的SWTプログラミング
Document Actions

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).

Nihongo unatenakunatta. Koredakara GUI application ha iya nanda.

Category(s)
program
linux
The URL to Trackback this entry is:
http://dev.ariel-networks.com/Members/matsuyama/linux7684swt30ed30e930df30f3/tbping
Add comment

You can add a comment by filling out the form below. Plain text formatting.

(Required)
(Required)
(Required)
(Required)
(Required)
This helps us prevent automated spamming.
Captcha Image


Copyright(C) 2001 - 2006 Ariel Networks, Inc. All rights reserved.