[java] GUI

Started by
5 comments, last by Smoo 23 years, 10 months ago
Is it possible to drop the standard window frame look in java and create your own gui frame? Thanks, Smoo
Advertisement
Yes, I think so, but you may have to extend it from normal window or JWindow, because to my knowledge you can''t change it''s current look so you have to draw a picture on window and put all kinds of window widgets on it or just copy those ones from awt.frame.
If you use JFrame you could make your own Look and feel so you could change everything (from the label to the window)

You should look the javax.swing.plaf.metal source code for examples.
Thanks for the info folks I''ll have to check that out.

Smoo
Are there any good tutorials or documentation out there about creating your own custom look-and-feels??? I have always wanted to try it.

Marcus
Marcus,

That''s one thing that I''ve noticed was lacking. PLaF tutorials, and downloadable LaFs. Why aren''t there ''jskin'' repositories? Maybe that''s a niche (sp?) we can fill here at game dev.
First, answer to the original question from Smoo:
You can kind of do it, but not exactly. The java.awt.Frame and java.awt.JFrame UI components unfortunately use the native windowing systems windows and borders. That''s why they don''t change their Look''n''Feel with the rest of the UI components. But you can work around this by creating an invisible Frame (create a Frame and set its bounds to -100,-100,10,10) with the title you want and then creating an java.awt.Window that has that frame set as its parent. Now you can set that Window''s border to whatever you want. The user will only see this window and believe it is the main window of your program.

I''ve been also wondering why there is no repository for Java look''n''feels. I''ve experimented with making an own l''n''f and it is quite a huge undertaking if you don''t use some other l''n''f as the basis. But someone must have done those...
-Pasi Keranen

This topic is closed to new replies.

Advertisement