Search code examples
javaswtright-to-left

Right to Left Shell in SWT


I want to mirror (Right to Left mode) the title bar control buttons (close, minimize and maximize buttons) using SWT in Java. I searched everywhere and came across this link but it does not work for me.

Please help me.


Solution

  • In order to explicitly change the orientation of an SWT control, use

    setOrientation( SWT.RIGHT_TO_LEFT );
    

    It is also possible to pass the RIGHT_TO_LEFT style flag to the constructor, for example

    new Shell( parent, SWT.DIALOG_TRIM | SWT.RIGHT_TO_LEFT );