This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
/* here nothing happens untill I store new mframe1() object is frame f object and call f.show(). frame f=new mframe1(); f.show(); please explain it to me.Is it due to layout as in border layout I don't have to add f.show. */
Do layout have different initialization format. jaideep
Window, Frame and Dialog default to invisible, while all other components default to visible (like buttons). In your first example, you called setVisible(true) which was on the Frame you extended. The show method makes a window visible AND brings it to the front. In your second example, you did not make the frame visible by either method.