This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Suppose I have a JFrame and JPanel. I make the size of JPanel(e.g. size 300*300) smaller than the JFrame(e.g size 500*500) and add the JPanel to the JFrmae's contentPane. I want to always keep the size of the JPanel(e.g it should not expand)and dispay it in the middle of the JFrame, even the JFrame is resized. Can anyone please tell me how can I do this?