E D R , A S I H C RSS

Standard Widget Toolkit

Eclipseì˜ ê·¼ê°ì´ ë˜ëŠ” Javaìš© 그래픽 íˆ´í· Eclipse 2.1 ë¶€í° ê³µìì ìœ¼ë¡œ SWTê°€ ë¶ë¦¬ë˜ì–´ ë°°í¬ë˜ê³  있ë¤.
"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 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 2.1 ë¬¸ìœ - Code Snippets ê°€ ë§Žììœ, ë”°ë¼í˜ê¸° ìš©ì´í˜ë¤.

~cpp HelloWorld 를 만들어 ë³´ìž.

  1. SWT를 ë¤ìš´ë¡œë“œ 받는ë¤. Eclipse downlaodììœ ë°›ì수 있ë¤. Upload:swt-2.1-win32.zip
  2. 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();
    	}	
    }
    
  3. ì¤í–‰ì ìœí‚¤ê¸° ìœí´ìœ, ì¤í–‰ë˜ëŠ” ìœì¹˜ì— swt-win32-2133.dll (Windows 경우)ê°€ ìžˆì–´ì¼ íœë¤.
  4. ì¤í–‰ 모습
    SWT_HelloWorld.png


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:06
Processing time 0.0114 sec