Source Code : Label Separator

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Label Separator

Label Separator

/******************************************************************************
 * Copyright (c) 1998, 2004 Jackwind Li Guojie
 * All right reserved. 
 * 
 * Created on Jan 26, 2004 9:29:09 PM by JACK
 * $Id$
 * 
 * visit: http://www.asprise.com/swt
 *****************************************************************************/



import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

public class LabelSeparator {
  Display display = new Display();
  Shell shell = new Shell(display);
  
  Image image = new Image(display, "java2s.gif");

  public LabelSeparator() {
    init();
    // shell.setLayout(new RowLayout());
    
    Label label = new Label(shell, SWT.BORDER);
    // Label label = new Label(shell, SWT.SEPARATOR);
    label.setImage(image);
    label.setText("Label");
    label.setBounds(10, 10, 150, 150);
    
    CLabel clabel = new CLabel(shell, SWT.SHADOW_IN);
    clabel.setImage(image);
    clabel.setText("CLabel");
    clabel.setBounds(170, 10, 150, 150);
    
    shell.pack();
    shell.open();
    //textUser.forceFocus();

    // Set up the event loop.
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        // If no more entries in event queue
        display.sleep();
      }
    }

    display.dispose();
  }

  private void init() {

  }

  public static void main(String[] args) {
    new LabelSeparator();
  }
}


           
       

Thank with us