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