How will you add panel to a Frame

Showing Answers 1 - 2 of 2 Answers

dinakaran

  • May 11th, 2005
 

get the frames contentpane and add the panel 
 
frame.getContentpane().add(panel);

  Was this answer useful?  Yes

neha

  • Aug 22nd, 2011
 

JFrame f=new JFrame();
JPanel p=new JPanel();
f.add(p,BorderLayout.CENTER);

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions