That was correect, but a bit laconic.
This is where you find out about the single thread policy. As for not extending JFrame, you should do this:-Don’t use null layout. You often do not need to get the content pane separately from the frame.

Abhimanyus singh
Greenhorn

Joined: Apr 11, 2012
Posts: 27

posted Mar 10, 2013 12:35:39

0

Campbell Ritchie wrote:That was correect, but a bit laconic.
This is where you find out about the single thread policy. As for not extending JFrame, you should do this:-Don’t use null layout. You often do not need to get the content pane separately from the frame.

It's still not working...let me explain it....the moment I run the program, it opens the frame in MAXIMIZED mode.!!! Earlier it was not happening.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44016

33

posted Mar 11, 2013 02:13:38

0

Abhimanyus singh wrote: . . .....the moment I run the program, it opens the frame in MAXIMIZED mode.!!! Earlier it was not happening.

not sure if this will help, just a couple points. i also don't extend JFrame anymore but i used to.
first, you shouldn't have to call super() in the constructor. at least i didn't have to using no argument constructor and calling setTitle(String) in it.
second you don't have to say "this" all the time.
setSize(200, 200);
and
setVisible(true);
is sufficient.

Randall Twede wrote: first, you shouldn't have to call super() in the constructor. at least i didn't have to using no argument constructor and calling setTitle(String) in it.
try getting rid of the call to super(h)

The OP doesn't have a super() but rather a super(h) call which is akin to setTitle(String title).

Randall Twede wrote: second you don't have to say "this" all the time.

Technically correct. But it is a good practice to use this.xxx and super.xxx as much as possible.

I suspect the OP is executing some old code and getting the strange results. Like Darryl said, once we know exactly, how it is being executed, we will know