Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

'Jpanel' cannot be resolved to a type error

807589Jul 28 2008 — edited Jul 28 2008
Hi all,
I need to pass a Jpanel to an object. I have added my code below.
public void createFrame(Object panel){
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		frame.getContentPane().add( (Jpanel)panel);
		frame.pack();
		frame.setVisible(true);
	}
In this
frame.getContentPane().add( (Jpanel)panel);
shows error as 'Jpanel' cannot be resolved to a type.
What is the correct approach for this?
Please help.
Rony
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2008
Added on Jul 28 2008
2 comments
1,841 views