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