Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3488398
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:15:57+00:00 2026-05-18T11:15:57+00:00

Is there a STYLE bit that I could apply to my shell/dialog to prevent

  • 0

Is there a STYLE bit that I could apply to my shell/dialog to prevent horizontal resizing? I would like the window to allow vertical resize only.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:15:58+00:00Added an answer on May 18, 2026 at 11:15 am

    Use the ControlListener to capture the resize event of the window.
    If user try to change width of the window restore the default value of it.

    import org.eclipse.swt.events.ControlAdapter;
    import org.eclipse.swt.events.ControlEvent;
    import org.eclipse.swt.graphics.Rectangle;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;
    
    public class TestWindow {
    
        private static int CONST_WIDTH = 200;
    
        public static void main(String[] args) {
            Display display = new Display();
            final Shell shell = new Shell(display);
            shell.setBounds(shell.getBounds().x, shell.getBounds().y, CONST_WIDTH, shell.getBounds().height);
            shell.setText("Test");
    
            shell.addControlListener(new ControlAdapter() {
    
                @Override
                public void controlResized(ControlEvent e) {
                    Rectangle rect = shell.getBounds();
                    if(rect.width != CONST_WIDTH) {
                        shell.setBounds(rect.x, rect.y, CONST_WIDTH, rect.height);
                    }
                }
            });
    
            shell.open();
            while(!shell.isDisposed()) {
                if(!display.readAndDispatch()) {
                    display.sleep();
                }
            }
            display.dispose();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why is there no list-style infinite type error when I define something like this
Are there any libraries that support JSTL style coding in an ASP MVC view?
Is there a simple way to style element like this? Supposed to be used
Is there some tool that can automatically convert the following c style code A
I would like to know if there is a fundamental reason for limiting the
I'm having a bit of trouble finding a nice little jquery plugin that would
I have a GUI with a flat style for the buttons. I would like
$('#myImage').removeAttr('class').removeAttr('style').removeAttr('border'); That one works just fine but is there a way to remove a
This may be a matter of style, but there's a bit of a divide
Is there a style for a select option's selected color? For example: <HTML> <BODY>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.