BLOG ARTICLE SWT/JFACE | 1 ARTICLE FOUND

  1. 2008/01/12 Label Test (2)

사용자 삽입 이미지


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 Label_Test {


    public static void main(String[] args) {
        Display display = new Display();

        Shell shell = new Shell(display);

        
        Label shadow_label = new Label(shell,SWT.UP);
        shadow_label.setText("SWT.SHADOW_IN");
        shadow_label.setBounds(30, 10, 110, 15);
        
        Label shadow_sep = new Label(shell, SWT.SEPARATOR|SWT.HORIZONTAL|SWT.SHADOW_IN);
        shadow_sep.setBounds(30, 35, 110, 5);
        
        
        Label shadow_label1 = new Label(shell,SWT.CENTER);
        shadow_label1.setText("SWT.SHADOW_OUT");
        shadow_label1.setBounds(30, 60, 110, 15);

        Label shadow_sep1 = new Label(shell, SWT.SEPARATOR|SWT.HORIZONTAL|SWT.SHADOW_OUT);
        shadow_sep1.setBounds(30, 85, 110, 5);
        
        Label shadow_label2 = new Label(shell,SWT.DOWN);
        shadow_label2.setText("SWT.SHADOW_NONE");
        shadow_label2.setBounds(30, 100, 110, 15);

        Label shadow_sep2 = new Label(shell, SWT.SEPARATOR|SWT.HORIZONTAL|SWT.SHADOW_NONE);
        shadow_sep2.setBounds(30, 125, 110, 5);

        shadow_label.pack();
        shadow_label1.pack();
        shadow_label2.pack();
        
        shadow_sep.pack();
        shadow_sep1.pack();
        shadow_sep2.pack();
        shell.pack();
        

        shell.open();

        while (!shell.isDisposed())
            if (!display.readAndDispatch())
                display.sleep();

        display.dispose();
        
        
        shadow_label.dispose();
        shadow_label1.dispose();
        shadow_label2.dispose();

        shadow_sep.dispose();
        shadow_sep1.dispose();
        shadow_sep2.dispose();
    }

}

----------------------------------------

Lable 3개와

구분선 을 나타내는 소스이다.



이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License