Archived

This topic is now archived and is closed to further replies.

Smoo

[java] GUI

Recommended Posts

Smoo    122
Is it possible to drop the standard window frame look in java and create your own gui frame? Thanks, Smoo

Share this post


Link to post
Share on other sites
Arch@on    100
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.

Share this post


Link to post
Share on other sites
strf    122
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.

Share this post


Link to post
Share on other sites
MarcusLM    152
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

Share this post


Link to post
Share on other sites
Jim_Ross    122
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.

Share this post


Link to post
Share on other sites
javanerd    122
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...

Share this post


Link to post
Share on other sites