Results 1 to 4 of 4
  1. #1
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default How to make the menu bar objects appears from right to left

    I want to make the menu bar objects appears from right to left. The default behavior is from left to right. Anybody knows how to change this behavior?

  2. #2
    johnt is offline Super Moderator
    Join Date
    Apr 2007
    Posts
    30
    Rep Power
    0

    Default

    Call following method of your menubar:

    Java Code:
         menubar.setLayout(new FlowLayout(FlowLayout.RIGHT));
    and add the menu items backwards. If normal is File, Edit, Help, add them as Help, Edit, File. It should work.

  3. #3
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    Thank you. It worked! :)

  4. #4
    vata2999 is offline Member
    Join Date
    Jul 2007
    Posts
    8
    Rep Power
    0

    Default

    Also you can use ComponentOrientation
    JPanel jContentPane;

    jContentPane.setComponentOrientation(ComponentOrie ntation.Right_TO_LEFT)

    for more information :
    Using Layout Managers (The Java™ Tutorials > Creating a GUI with JFC/Swing > Laying Out Components Within a Container)
    Last edited by vata2999; 07-19-2007 at 11:14 AM. Reason: Add a link

Similar Threads

  1. Replies: 7
    Last Post: 05-09-2008, 07:54 AM
  2. menu in top left always
    By sschwinghammer in forum New To Java
    Replies: 2
    Last Post: 02-06-2008, 02:39 PM
  3. Replies: 1
    Last Post: 01-15-2008, 07:12 PM
  4. Using SWT Menu
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-09-2008, 12:04 PM
  5. Alert box showing time left
    By hasansheikh18 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 11-19-2007, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •