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.0105 sec