Sunday, August 7, 2011

setUndecorated before setVisible

As we seen in the post,we can show the frame without the Title Bar by calling the method setUndecorated(true) on a JFrame.

One thing that should be noted is that we should call this method before calling the method setVisible(true); on a JFrame eotherwise we will not be able to draw the frame without Title Bar..
as it will throw IllegalComponentStateException if we call setUndecorated(true) after calling the setVisible(true) method on a JFrame...

So,be sure that you call setUndecorated method before calling the setVisible method....

0 comments:

Post a Comment