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

  • Home
  • SEARCH
  • 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 8521637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:53:00+00:00 2026-06-11T06:53:00+00:00

I am developing and running my Java application on OS X Mountain Lion, and

  • 0

I am developing and running my Java application on OS X Mountain Lion, and I added “Yes” and “No” options to a custom dialog box. However, when I ran my application on Windows 7, I noticed that the “Yes” and “No” options were reversed. To fix this UI glitch, I added this code:

    String msg = "Are you sure you want to cancel the selected bookings?";
    String[] options = new String[] { "Yes", "No" };
    int noOption = 1;
    String os = System.getProperty("os.name").toLowerCase();
    if ("mac os x".equals(os)) {
      options = new String[] { "No", "Yes" };
      noOption = 0;
    }

    int option =
        JOptionPane.showOptionDialog(null, msg, "Confirm Unbooking",
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options,
            options[noOption]);
    if (option == noOption) {
      return;
    }

Can someone tell me why I experienced the issue that I described in the first place? I have a feeling that it has to do with the L&F of the application. 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-06-11T06:53:01+00:00Added an answer on June 11, 2026 at 6:53 am

    It is indeed a L&F feature that performs this (this is not a UI glitch). I would recommend not to change that for a better user-experience. Users expect application to be consistent on a platform. Windows & Linux are used to have buttons displayed from left to right, while MacOS are used to have buttons displayed from right to left.

    See here two samples:

    Windows:

    enter image description here

    MacOS:

    enter image description here

    See how on MacOS, the most important button is displayed on the far right, while it is the opposite on Windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing a Java cross-platform (windows and mac os x) application running
Im developing a simple console application using java. I want to display currently running
I am developing an application that will be running behind the scenes in Windows
I am developing a java web application and I am running it on a
I am developing a web application in which I am running Java in the
I have a java web application that I am developing in Netbeans (and running
I'm developing a Swing-based Java application in Eclipse on Windows XP. I have a
i'm developing an application running on WebLogic 10 and of course in java. Ok,
I am developing an application that will use MongoDB running on Windows Azure. This
I am developing an email campaign however find myself running into an issue specific

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.