I am new to the forum, so I apologize for any daft moments :)
I searched for this topic and only got topic on disabling the maximize button, so here goes.
I need to set my jFrame (which is also my main class) to maximize in startup. To set it to be the same size as the screen is not good enough, because that means that someone might accidentally move it.
Any suggestions?
Thanks,
Marcus
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1787
2
posted
0
Marcus Rag
Greenhorn
Joined: Dec 23, 2009
Posts: 6
posted
0
Thanks Rob,
but where in my code do I put this?
cheers
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1787
2
posted
0
Experiment. How long does it take to add that line of code in your program to see what it does.
Marcus Rag
Greenhorn
Joined: Dec 23, 2009
Posts: 6
posted
0
I already have experimented...and it takes very long. I constantly get the error that the non-static method can not be referenced from a static contexted...
Either call frame.setExtendedState(...) where frame is your JFrame instance, or call it inside an instance method of the JFrame. That's not so hard, is it?