Andy Joness wrote:What is the simplest/cleanest way of creating "pages"? I can't decide between jFrames (just setting visibility) and CardLayout. Is there a better way?
I wouldn't use JFrames. The user will notice the current frame disappearing and a new one reappearing. CardLayout is designed for this type of work, where you replace (a part of) the current user interface with something else.
Secondly I am going to run it in fullscreen. How would I go about getting the frames/panels to automatically resize to the specified resolution? I plan on having a settings page with several resolutions available. The page contents(controls) need to automatically position themselves relative to the borders.
Use GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame) to set the the JFrame called "frame" as the fullscreen window on your default screen.
Lastly my method of using background images on frames involves instantiating a frame using this code:
Is this good, or is there a more efficient way? Cheers
Looks good, except for the creation of the image. That piece of code won't compile. Change it into this instead:
I'll move this
thread to our gaming forum.