• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

java gui on linux?

 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have programmed using GTK++ , and QT with X11 libraries on linux based machines.

What I am trying to understand is what does java call to make it's gui.
What I mean is say you have a JFrame and setVisible ...etc so it pop's up a gui Frame box.

How it works in windows is when you install java it comes with dll's for awt and swing that call the win32 api's graphics/windows gui functions
I am wondering what java on linux does , is it just shipped with the equivalent awt.dll but as awt.so library that calls the x11 libraries.
I am assuming these dll's that where used for windows and the source that generates them would need to be completely rewritten and recompiled for a linux gui functions on a linux machine

Also is the native functions that JFrame and other gui java stuff uses calling desktop manger gnome functions , windows manager functions or more general x11 top level functions.
Since if you change the desktop manger or windows manager it seems to change the JFrame look and feel?

Wondering if anybody knows the inner workings of this and can elaborate
 
Bartender
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the Linux JRE comes with its own set of native libraries. Swing ships with a set of LAFs (Look-And-Feels) on each platform; on Linux CDE/Motif and/or GTK+ LAFs are available, amongst others. See http://en.wikipedia.org/wiki/Pluggable_look_and_feel and http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html for more details.
 
Sam Doder
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cool,
also is it possible to get a LAF on linux that looks exactly like xp or vista running under gnome? Or is the look and feels for java gui programs (or maybe even more general any gui program)
restricted to the look and feels of the desktop/windows manager you are under?

If it is restricted to the desktop/windows manager that is running on your linux system then the only way to get a windows look and feel on a linux system is to install a desktop/windows manager that can look like a windows system one. Assuming of ofcourse your not running your java or gui program on wine , virtualbox or any other virtual based tool that emulates another system.
Yes /No?

Question 2
Is their anyway to create your own theme or look in feel under linux? Like in ubuntu I can go to the desktop properties and select from a whole bunch of different themes , colors , fonts ,...etc.
Is their away to create your own or import/get a new them that looks exactly like windows 7 or something else???
 
Tim Moores
Bartender
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

is it possible to get a LAF on linux that looks exactly like xp or vista running under gnome? Or is the look and feels for java gui programs (or maybe even more general any gui program) restricted to the look and feels of the desktop/windows manager you are under?


The Windows LAF can emulate XP and Vista depending on where it's running, according to the Oracle doc I linked to, but you'd have to do a little bit of patching to make it run on non-Windows JREs (see the isNativeLookAndFeel and isSupportedLookAndFeel methods in the com.sun.java.swing.plaf.windows.WindowsLookAndFeel class).

Is their anyway to create your own theme or look in feel under linux? ... Is their away to create your own or import/get a new them that looks exactly like windows 7 or something else?


The synth LAF is meant for customization. It's based on XML files, though - maybe someone, somewhere has written a GUI editor for it, but I doubt that. I also doubt that it lets you get anywhere near to a proper WIndows appearance, but that's pure conjecture on my part.
 
Saloon Keeper
Posts: 28654
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The acronym to look for is "PLAF" - Programmable Look And Feel.

However, unless you're trying to con Windows users into using Linux, making Linux look/act like Windows isn't going to make you very popular!
 
Sam Doder
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, just trying to get a program to look the same on any platform/machine out their. (Regardless of weather it is x11 , or windows )

startx -- : 1 ,2,... , ctrl+alt+f7,8,9,...

 
Tim Moores
Bartender
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In that case, why not go with the Ocean or Nimbus LAFs?
 
Sam Doder
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks didn't know that all set
 
reply
    Bookmark Topic Watch Topic
  • New Topic