• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GUI looks different on Windows and Linux as compared to Mac

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i developed a GUI on my Mac using Netbeans Mattisse. It looks fine on Mac where as when i try to run the application on Windows or even on Linux the look and feel is completely different. The font looks different, the color looks different, the borders look different and is a kind of really bad when compared to the look and feel on Mac. I have added the same libraries as on Mac. Am wondering what else am missing???

Please do help me regarding this!

Thanks in advance....
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How the GUI looks is determined by the look&feel. By default, Windows and Linux use a cross platform look&feel, but they can switch the look&feel to a system look&feel. That way, it can look like a Windows application in Windows and like a Linux (or at least GTK) application in Linux.

The Mac look&feel is an Apple proprietary look&feel which cannot be ported to Windows or Linux, legally speaking. Perhaps you can do a search on Google to find an attempt by someone to copy it, but that's as far as you're going to get.

But, if you don't like the default look&feel, try a different one available. See http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html. You can get all available look&feels like this:
With an instance of UIManager.LookAndFeelInfo you can set that look&feel:
 
Jiss Elizabeth
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rob, but does this mean that i need to create a GUI for Windows/Linux all over again?
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you used a good layout manager, the GUI should still look more or less the same - at least as far as the layout goes.
If you haven't, and you've used setBounds() for all your components, then yes, you're screwed. Every component that has a different size on Windows / Linux will mess up your entire GUI layout.
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jiss Varghese wrote:i developed a GUI on my Mac using Netbeans Mattisse...



I think that this is the key problem. Use decent layouts (per the Sun layout manager tutorial) and avoid creating GUIs with Mattisse, and you'll probably find your apps look much better on different systems.
 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Screenshots please ???
 
reply
    Bookmark Topic Watch Topic
  • New Topic