Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

plinden

macrumors 601
Original poster
Apr 8, 2004
4,029
142
I'm a Java programmer with loads of experience in application code but none in GUI development. I decided to get some experience by writing a crossplatform GUI frontend to some web-related Java utilities I wrote, so I'm doing a simple GUI using Swing and Eclipse.

Now, I want this to work like a Mac program as well as on Windows and Linux. For the Mac I am able to get the screen menu bar displaying the menus, but I can't work out how to display the application name properly, and I can't find anything online (I can do this in XCode, but like I said, I want to use Eclipse so I'm sure it's crossplatform). See the screen shot. Anyone with Java+Swing+Mac experience know how to modify this?
 

Attachments

  • Picture 3.png
    Picture 3.png
    14.4 KB · Views: 2,497

therevolution

macrumors 6502
May 12, 2003
468
0

plinden

macrumors 601
Original poster
Apr 8, 2004
4,029
142
Thanks, that works. I missed that when I read the Apple docs.
 

rand0m3r

macrumors regular
Jun 30, 2006
115
1
just wondering. are you saying that you can write a program in java and use the cocoa framework to put an aqua interface on it, while it still maintains its java swing GUI on non-Mac platforms?
 

plinden

macrumors 601
Original poster
Apr 8, 2004
4,029
142
No, it won't be Cocoa, just a Swing GUI on all OSs - you can follow the Mac OS guidelines though, by checking the OS and if it's OS X, move the menu bar to the top and bind the application menu items differently (ie. if it's OS X use Preferences, About etc instead of menu items.)

I might look into doing it as a Cocoa app in XCode though. I'm using the classic MVC architecture so I can do the UI differently. But I'm much more experienced in using Eclipse so that's what I'm doing first.
 

therevolution

macrumors 6502
May 12, 2003
468
0
just wondering. are you saying that you can write a program in java and use the cocoa framework to put an aqua interface on it, while it still maintains its java swing GUI on non-Mac platforms?

You don't use Cocoa to get the Mac look and feel in Java Swing apps. In fact, they look that way by default on Mac OS X - if you want to utilize a different Java look and feel, you have to explicitly change it. And yes, on non-Mac platforms you just specify another look and feel or use whatever defaults exist for that platform.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.