Programming language for Windows and Mac?

I'm trying to find a programming language that I can use to create an application that will run equally well on Windows and Mac, preferably without needing a Mac to compile, or different code for each platform.

Initial searches suggest Java might be suitable, but I saw a comment indicating the UI capabilities are pretty poor, and UI will be a big part of the application I'm making, so it's pretty important that it can do it well - buttons, checkboxes, options, tabs (think of the tabs in the event windows) and file selection/saving dialogs will be what I'll use most.

Anyone have other suggestions, or first-hand comments on Java?
What about C# ? I can't tell if it's good or not since I'm not a good programmer 😛
You can create web based front end with java back end running as a local application.
Or node.js :b
macOS is based on UNIX and Windows is not. Therefore, there are many differences to find a programming language that runs on both systems equally.

You could use JavaScript, HTML and CSS together with Electron. Electron allows you to build cross-plattfrom applications.
What about C# ? I can't tell if it's good or not since I'm not a good programmer 😛
I second C#, been working with it for some time and it's everything I could've hoped for.
I'm sorry, but you really need to have both a Windows and a Mac to properly test and feel how they work, particularly considering the importance you put on UI. The differences in navigation and layout design are significant.

Java Applications became well-known for their lowest-common denominator look and feel 10 years back. While they did function cross-platform the UI typically worked equally unwell on the different platforms. You can do some tricks like the following code, though they wouldn't really solve the problem:
Code:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

I would definitely choose C# over Java for creating a Windows application where the UI is in focus. I feel like the tooling for C# would support my task better. The real question is how well Xamarin works with macOS applications. I have no idea as I have never tested it.
Read up on the Fluent Design System for UWP apps and Human Interface Guidelines for macOS.

If you are not already using both system in your daily life then start deliberately incorporating the unused system. You get a better understanding of the subtle things as you start using it normally.

*hugs*
What exactly are you making? The choice of language will matter more for what your application is trying to do as it can also help you decide which cross platform solution you may wanna look at.

Qt is probably the BEST (and possibly the most standard) way to do cross platform desktop applications. It does however use C++ and you are going to need to compile your application under both Windows and OS X. You will want to test them to as I once made a simple Qt app and a text file I was reading from I assumed would be next to my "executable" on Mac. Nope that went wrong due to the way OS X handles .app packaging so I had to write somewhat different code for reading that text file even though the processing logic and the way the user interacted was 100% the same on both platforms. Not to mention, the LGPL license can complicate things. Unless you buy a commercial license of Qt, you will need to provide the Qt binaries your application uses and even then I'm not sure if you can sell Qt applications with the LGPL license. There are other C++ GUI frameworks for cross platform, but Qt is going to be your best bet if C++ is going to be your go to as it does provide a WYSIWYG interface for design and has way better support over other options.

Java is another option as others have said, but you have now required users to have Java installed which is becoming less and less common. Java UI programming however is tricky and a huge pain. Not to mention Java itself is a rather clunky language so unless your application is simple and performance isn't really a concern, I wouldn't touch Java. If you do however manage to create a Java application successfully, porting to other desktop platforms is usually trivial. You still need to test each platform though, I once made a newbie assumption when I created my first Java GUI application many years back that I ported over to Mac and it wouldn't even open. This was too long ago to remember exactly what went wrong though.

I see people here mention C#, but if cross platform is your goal then C# isn't really much of an option. It is a fantastic language and has fantastic GUI application support..... if you are on Windows. C# did become open source some years back, but the .NET framework takes its sweet old time coming to other platforms outside of Windows meaning your code will work great on Windows, but not on other platforms such as OS X because it hasn't received a more up to date .NET framework yet. If you only cared about Windows, C# would be the way to go 9 times out of 10, just like if you only cared for OS X, Objective-C or Swift would be the way to go 9 times out of 10.

JavaScript with Node.js is another option and is how RPG Maker MV practically handles portability. All it really does is use HTML5 and JavaScript code then put a launch wrapper around it to allow to execute directly from the OS. If you are making something real simple, this isn't a bad option. I personally haven't done this outside MV though, so I can't comment much on it but google does exist.

On the other hand, you could also just run a web application using JavaScript (and possibly other languages like PHP and MySQL as needed) in which case users would only need to just visit your application on the web using their favorite browser from their favorite OS. Unless you absolutely need your application to be in desktop form, this is by far the best way to hit most users. You will need to find a web host, but there are some options out there.

It really just depends on what your application is trying to do, what your requirements for the application are, and how you intend users to access and use the application. Every cross platform option is going to have drawbacks and there is no real "best" answer to this question. You will also need to test the application on all platforms, even if its browser based. Unless it has been tested, it is considered broken and not working.

Hope this can point you in the right direction.
Thanks for the responses.

I need something that will work with the file system, and from what I've seen with Javascript so far, it is very limited. I also don't know what its UI capabilities are - I'd hate to have to program a file selection window.

I don't have a Mac anymore and don't plan to get one. If I can't get a language that I can use to build the application in Windows and deploy to Mac, without needing a Mac to test, build, modify, then I will go with the option of only creating a Windows version, and in that case I'll probably use one of the .net frameworks (which I had no idea would even operate on Mac, so maybe that IS an option). I'm just not interested in working through the complexities of two operating systems in order to produce a Mac version - IMO payoff would not be worth the effort required.
JavaScript UI would be handled by HTML. JavaScript does not have UI support by itself and instead communicates with HTML for display. If you don't want to write your own file system, this could be a good start. https://codepen.io/matt-west/pen/KjEHg

As for a Mac, you might be able to look toward running OS X in a virtual machine. However, running Windows under a virtual machine requires having a license key to Windows that is not already being used elsewhere. You can at least buy Windows license keys. I know this because I run Windows 7 under a virtual machine. Apple is a bit more protective of their OS though so you may not be able to just purchase their OS without purchasing a physical Mac machine and its possible they may not want you running their OS outside of their hardware. I know hackintosh's aren't illegal, but I believe they might possibly violate their EULA so while this could be an option, I would put research into it.

If you do go the route of Windows only, then I suggest C# with WPF. It's pretty easy to get a simple GUI application going and has a lot of capabilities. Many standard Windows applications these days such as Microsoft Office are written in C# with WPF.
C# and .net core
C# and .net work on Mac? Natively?
Yes C#.NET is available on all platforms, but is prioritized on Windows so the latest versions may not be available on Mac. For GUI though you have less options and I believe Xamarin is the one most people would go to, but I never used Xamarin or done .NET development on Mac either.
mmm ... looks like you still need a Mac though, which is something I don't have (and won't be getting just for this, due to the cost and my extreme dislike of Apple products & services)

I'm giving Qt a go. I may still need a Mac to do a Mac build, but it might be something I can give to another person and get them to do.
Yeah I'm having the same issue with my extended generator or my game launcher ; as I am coding with Visual Studio, and as I do not own a Mac, I can't release anything on Mac for now. I wonder if there is a free Mac distribution that can be put on a virtual machine ?
Not legally.
Most versions of MacOS are forbidden to be installed on virtual machines, and the versions that are legal for virtual installations are the much more expensive server versions.

The cheapest way to get would be to check eBay for used Macs, that should give you an older one for around 100$ if you wait a bit for a good offer.
You can also use C# on windows and then use MONO to run your windows C# program on Mac OS. That will let you develop solely on windows, and run on MAC OS using the Windows Exe running in the MONO framework on MAC.
That means anyone I give this to, who's using a Mac, would need to run MONO as well.
So something I just learned now, since I never tried to deploy apps on a Mac to a wider audience (yet), is you are going to have to code sign your application if you deploy to Mac. This makes it so a security feature in Mac called Gatekeeper will see your application is trusted and users will be able to easily run it without bypasses. To my knowledge, the free Apple Developer license will allow code signing, but you need to do the signing yourself on a Mac and Apple's documentation on the process uses Xcode (which is Mac only). On the linked pages, you may notice an option for "anywhere" in the Gatekeeper window, however this is hidden come 10.12 Sierra making it more difficult for users to just run "untrusted" apps.

Bottom line being, if you are targeting more than a small group of Mac users and don't want to force them to jump through extra hoops to run the application, you are going to have to code sign and doing so requires a Mac.
The Mac audience will consist of people who own RPG Maker MV for Mac and who have the same struggles I do with creating their tilesets and maps and don't already have a way around it. So I expect it to be a very small population.

I've decided to stick with the language I used to write my original tileset converter program, as that can be run in a browser if I deploy as swf, or I can use a wrapper and deploy to both windows and Mac. I'm not going to jump through any Apple hoops.

I think this thread is resolved now.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/programming-language-for-windows-and-mac.83306/