Sign in to follow this  
RobAU78

[java] Use Swing Components?

Recommended Posts

RobAU78    206
It seems to me that Java's Swing components (JButtons, JTextFields, etc) have a lot of overhead that isn't necessary for developing games. So I'm wondering if making my own group of non-Swing components might be better. Does anyone have any thoughts to offer here? Thanks, Rob

Share this post


Link to post
Share on other sites
pinacolada    834
Couple thoughts,

1) Swing components have gotten a lot better and a lot less bloaty in recent versions
2) You could always use AWT components
3) There are 3rd-party component libraries out there. IBM has SWT which is apparently pretty sweet. It uses a lot of native code, which has its pros and cons (pros = performance, cons = different binaries for each OS, and cross-platform compatibility is questionable)
4) There's no reason why you can't make your own custom components. However in my experience, making your own custom widgets is one of those things that seems like a good idea at the time, but turns out to be way more work than you expect, and isn't worth the trouble in the long run.
5) Although, since we're talking about games, it may be worth it to make your own components for the sake of appearance. Games are suppossed to look good, and all of the GUI libraries mentioned so far are pretty butt-ugly

Share this post


Link to post
Share on other sites
RobAU78    206
Thanks for your thoughts, Pinacolada.

Right now, I'm working on an interface shell to use in my 4X space strategy game project. At the moment, I'm using Swing components to get the basic functionality down. Eventually, though, I think I'll make my own custom components.

Thanks again,
Rob

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this