I am new in java. I have drawn the UI in "init()" method ,which is called from the constructor of the class. Now, depending on the condition, I want to show / hide the last JPanel of the screen. For e.g. while display is still there and the condition is false, then the last JPanel should hide. Now if condition again becomes true, then the last JPanel should be shown.