Eclipse์ ๊ทผ๊ฐ์ด ๋๋ Java์ฉ ๊ทธ๋ํฝ ํดํท Eclipse 2.1 ๋ถํฐ ๊ณต์์ ์ผ๋ก SWT๊ฐ ๋ถ๋ฆฌ๋์ด ๋ฐฐํฌ๋๊ณ ์๋ค.
"Eclipse์ ์๋๊ฐ ๋น ๋ฅด๋ค." ๋ผ๋ ์ ์ ๊ฒฌ์ ๋ง๋ค์ด์ค ์ฅ๋ณธ์ธ์ธ Cross Platform Native Graphic Toolkit ์ด๋ค.
"Eclipse์ ์๋๊ฐ ๋น ๋ฅด๋ค." ๋ผ๋ ์ ์ ๊ฒฌ์ ๋ง๋ค์ด์ค ์ฅ๋ณธ์ธ์ธ Cross Platform Native Graphic Toolkit ์ด๋ค.
๋ด๋ถ์์๋ ์ด๊ธฐ๋ถํฐ SWT์ Eclipse ํ๋ก์ ํธ์ ์ญํ ์ด ๋ถ๋ด๋์ด, ๊ณผ๊ฑฐ IBM developerworks ์ gcc๋ฅผ ์ด์ฉํ ํ๋ก๊ทธ๋จ ์์ฑ์ ๋ํ ๋ฌธ์๊ฐ ์์์ผ๋, SWT๋ฅผ ์ด์ฉํ ํ๋ก๊ทธ๋จ์ ๋ฑ์ฅ์ ๋ณด์ด์ง ์์๋ค. ๊ทธ๋ฌ๋ ๋ถ๋ฆฌ๋๋ฉด์, ๊ทธ๋ฌํ ํ๋ก๊ทธ๋จ์ ๊ธฐ๋ํ ์ ์๊ฒ ๋์๋ค.
SWT ํ๋ก์ ํธ ํ์ด์ง
{{|
The most succinct description of the Standard Widget Toolkit component is this:
{{|
The most succinct description of the Standard Widget Toolkit component is this:
The SWT component is designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented.
--SWT ํ๋ก์ ํธ ํ์ด์ง ์์
|}}--SWT ํ๋ก์ ํธ ํ์ด์ง ์์
- SWT 2.1 ๋ฌธ์ - Code Snippets ๊ฐ ๋ง์์, ๋ฐ๋ผํ๊ธฐ ์ฉ์ดํ๋ค.
~cpp HelloWorld
๋ฅผ ๋ง๋ค์ด ๋ณด์. ¶
- SWT๋ฅผ ๋ค์ด๋ก๋ ๋ฐ๋๋ค. Eclipse downlaod์์ ๋ฐ์์ ์๋ค.
swt-2.1-win32.zip
- swt.jar ๋ฅผ classpath ์ ์ก๊ณ ๋ค์ ์์ค๋ฅผ ์ปดํ์ผ ํ๋ค.
~cpp import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class HelloWorld { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Hello World"); Label label = new Label(shell, SWT.NONE); label.setText("Hello World"); label.setBounds(20,20,100,100); shell.setBounds(20,20,300,300); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
- ์คํ์ ์ํค๊ธฐ ์ํด์, ์คํ๋๋ ์์น์ swt-win32-2133.dll (Windows ๊ฒฝ์ฐ)๊ฐ ์์ด์ผ ํ๋ค.
- ์คํ ๋ชจ์ต