i would love to have some of my app windows appear as floating
palette windows (always on top and with a very small window bar
only). i know that as of java 1.5 i can use setAlwaysOnTop. but
what is the best way to get the frame bar look like those small
palettes (which you know from photoshop etc.)? is there a trick to
tell the Aqua LnF to use these instead of the big ones? otherwise,
i know i could use setUndecorated and use custom frame bar
painting, but then it might not be consistent with future versions
of the Mac OS X ...
In 1.4+ Swing PLAFs have the notion of the Window Decorations
being provided by the native windowing system or by the PLAF.
See LookAndFeel.getSupportsWindowDecorations() and
JRootPane.setWindowDecorationStyle. However, the effect of each
of these options is platform dependent, and some PLAFs do not
support the setWindowDecorationStyle functions (Metal does, I
think Aqua does not, I've not checked any other PLAFs). If you
look at the source for the Metal PLAF, you can see that it does
this by making the frame undecorated and providing its own
components for the decorations (as well has processing mouse
events etc. to make things like dragging the frame around work).
You could use the Metal implementation as an example of how to
decorate your own frame.
If you want to work in pure, platform independent Java, these
are your options. If you want to look native on each platform,
you'll need to customize your decorations based on the PLAF in
use, and produce graphics compatible with the native look for
each as well (e.g. texture maps for the mini-titlebar).
If you don't mind writing platform-specific code to handle each
platform, you've got other options. For OS X you can use JAWT to
get access to the underlying AppKit components (e.g. NSWindow)
and use native operations. In X11 JAWT gives you access to the
X11 Window IDs, but not the X11 event loop. In Windows you can
get the HWND. Going this route is a lot more work, and requires
development systems for each platform. You can do a lot more
this way, but it costs. If you need to produce your own graphics
to match the native Aqua look, it might be less work than using
pure, cross-platform Java.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden