SWT 3: shellstyle

Source: Internet
Author: User
  1. Import org. Eclipse. SWT. Widgets. display;
    Import org. Eclipse. SWT. Widgets. shell;
    Import org. Eclipse. SWT. SWT;
  2. Public class shellstyle {
  3. /**
    * @ Param ARGs
    */
    Public static void main (string [] ARGs ){
    // Todo auto-generated method stub
    Display display = New Display ();
    Shell topshell = new shell (Display );
    Topshell. settext ("window style ");
    Topshell. setsize (500,400 );
    Topshell. open ();

    Shell style1 = new shell (display, SWT. Title );
    Style1.settext ("show title only ");
    Style1.setsize (50, 40 );
    Style1.open ();

    Shell style2 = new shell (display, SWT. Close );
    Style2.settext ("show close only ");
    Style2.setsize (50, 40 );
    Style2.open ();

    Shell style3 = new shell (display, SWT. min );
    Style3.settext ("show to minimize only ");
    Style3.setsize (100, 40 );
    Style3.open ();

    Shell style4 = new shell (display, SWT. max );
    Style4.settext ("maximize display only ");
    Style4.setsize (100, 40 );
    Style4.open ();

    Shell style5 = new shell (display, SWT. Border );
    Style5.settext ("display border ");
    Style5.setsize (50, 40 );
    Style5.open ();

    Shell style6 = new shell (display, SWT. Resize );
    Style6.settext ("variable size ");
    Style6.setsize (50, 40 );
    Style6.open ();

    Shell style7 = new shell (display, SWT. no_trim );
    Style7.settext ("no border or title ");
    Style7.setsize (50, 40 );
    Style7.open ();

    Shell style8 = new shell (display, SWT. shell_trim );
    Style8.settext ("full display ");
    Style8.setsize (50, 40 );
    Style8.open ();

    Shell style9 = new shell (display, SWT. dialog_trim );;
    Style9.settext ("dialog box ");
    Style9.setsize (50, 40 );
    Style9.open ();

    // You can also use the following: SWT. application_modal, SWT. modeless, SWT. primary_modal
    // SWT. system_modal and other combinations use the | delimiter

    Shell style10 = new shell (display, SWT. Close | SWT. Resize );
    Style10.settext ("multiple styles ");
    Style10.setsize (50, 40 );
    Style10.open ();

    While (! Topshell. isdisposed ())
    {
    If (! Display. readanddispatch ())
    {
    Display. Sleep ();
    }
    }
    Display. Dispose ();

    }
  4. }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.