<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codebreaker &#187; SWT</title>
	<atom:link href="http://blog.sumin.us/archives/tag/swt/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.sumin.us</link>
	<description>2bc08752a0894eb2c7afb345286e391d</description>
	<lastBuildDate>Wed, 08 Sep 2010 02:15:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SWT 사용하기</title>
		<link>http://blog.sumin.us/archives/21</link>
		<comments>http://blog.sumin.us/archives/21#comments</comments>
		<pubDate>Wed, 27 Jul 2005 12:45:43 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SWT]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/?p=21</guid>
		<description><![CDATA[swt-3.1-win32-win32-x86 swt-win32-3138.dll 를 JAVA_HOME/bin 디렉토리로 복사하고 (이클립스)프로젝트 설정에서 swt.jar 를 불러오도록 하면 된다. 이걸 몰라서 한참 헤맸었다;; SWT를 사용해서 만든 윈도우와 몇가지 컨트롤들의 모습이다. AWT와는 다르게 깔끔하다. 메모리 사용량은 어떨지 모르겠지만ㅋ 지금 javaw 프로세스의 메모리 사용량이 120MB를 넘어갔는데(-_-;;) 이클립스 때문이다. 미리 로드해놓은게 있어서 그런지 내가 만든 프로그램을 실행시켜도 메모리 사용량이 100KB 이상 늘어나거나 하지는 않는다. [...]]]></description>
			<content:encoded><![CDATA[<p>swt-3.1-win32-win32-x86</p>

<p>swt-win32-3138.dll 를 JAVA_HOME/bin 디렉토리로 복사하고
(이클립스)프로젝트 설정에서 swt.jar 를 불러오도록 하면 된다.
이걸 몰라서 한참 헤맸었다;;</p>

<p>SWT를 사용해서 만든 윈도우와 몇가지 컨트롤들의 모습이다.</p>

<p><img src="/wp-content/userdata/swt.gif" width="450" height="400" alt="" /></p>

<p>AWT와는 다르게 깔끔하다.
메모리 사용량은 어떨지 모르겠지만ㅋ</p>

<p>지금 javaw 프로세스의 메모리 사용량이 120MB를 넘어갔는데(-_-;;) 이클립스 때문이다. 미리 로드해놓은게 있어서 그런지 내가 만든 프로그램을 실행시켜도 메모리 사용량이 100KB 이상 늘어나거나 하지는 않는다.</p>

<p>아래는 소스코드.</p>

<pre><code>import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.*;

public class HelloWorld
{
    public static void main(String[] args)
    {
        Display display = new Display();

        int intvLeft = 20;
        int hlocation = 0;

        Shell shell = new Shell(display);
        shell.pack();
        // shell.setLayout(new GridLayout());
        shell.setSize(450, 400);
        shell.setText("This is a window using SWT");

        Label label = new Label(shell, SWT.NONE);
        label.setText("Hello World!");
        label.pack();
        label.setLocation(intvLeft, hlocation);
        hlocation += 30;

        Button button = new Button(shell, SWT.BUTTON1);
        button.pack();
        button.setText("This is a button");
        button.setLocation(intvLeft, hlocation);
        button.setSize(120, 24);
        hlocation += 40;

        Slider slider = new Slider(shell, SWT.HORIZONTAL);
        slider.pack();
        slider.setLocation(intvLeft, hlocation);
        hlocation += 30;

        Text text = new Text(shell, SWT.MULTI | SWT.WRAP);
        text.pack();
        text.setText("The quick brown fox jumps over the lazy dog.");
        text.setLocation(intvLeft, hlocation);
        text.setSize(400, 100);
        hlocation += 110;

        List list = new List(shell, SWT.MULTI | SWT.V_SCROLL);
        list.pack();
        list.add("State the nature of your medical emergency");
        list.add("What is your major malfunction?");
        list.add("Something on your mind?");
        list.add("Somebody called for an exterminator");
        list.add("Awaing instructions");
        list.setLocation(intvLeft, hlocation);
        list.setSize(400, 50);
        hlocation += 70;
        shell.open();

        /*
        MessageBox messageBox = new MessageBox(shell, SWT.OK | SWT.CANCEL | SWT.ICON_INFORMATION);
        messageBox.setMessage("Message");
        messageBox.setText("Text");
        if (messageBox.open() == SWT.OK)
            System.out.println("Ok is pressed.");
        */

        // FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
        // System.out.println(fileDialog.open());

        while(!shell.isDisposed())
            if(!display.readAndDispatch())
                display.sleep();

        display.dispose();
        label.dispose();
    }
}
</code></pre>
<!-- AdSense Now! V1.83 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-leadout" style="text-align:center;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-2353453386862167";
/* 468x60, created 10/26/09 */
google_ad_slot = "1252542387";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/21/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
