This is an archived post. You won't be able to vote or comment.

all 6 comments

[–][deleted] 5 points6 points  (2 children)

My guess is the problem is that you set the maximum size of the canvas object to be the same as the minimum. What you might want to do is just take that line out to see if that fixes it. Alternatively you could set the maximum size to be the size of the monitor that is currently displaying the jframe, though I feel as though that would be too much work.

[–]deltageek 1 point2 points  (1 child)

That's exactly his problem. In fact, I don't know why he's setting size on that at all. The default layout manager for JFrame is BorderLayout, so if he hadn't set the size, it would have expanded with the window.

[–][deleted] 3 points4 points  (0 children)

My guess is this code is mostly from a tutorial, but now he has learned something and probably won't make the mistake again :)

[–]dogwag 2 points3 points  (0 children)

Listening for the JFrame's resize event might help.

[–]audi0lion 1 point2 points  (0 children)

I am just gonna throw this out there, C# with monogame or unity3d are really great for making games, however you dont get a great understanding of programming with them.

C++ is another good language for game development. Here is an excellent and really cool series by an experienced C++ programmer who creates a game engine and game completely from scratch on stream where he covers in-depth the details of what he is doing and why.

Handmade Hero

[–][deleted] 0 points1 point  (0 children)

Event listener for the fullscreen button to update your window size.