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 경우)ê°€ 있어야 한다.
- 실행 모습