How to get jframe instance from a jpanel
918178Sep 11 2012 — edited Sep 12 2012Hi,
I am working on a Java swing framework in my project. I am extending a project customized panel. For one of my requirement I need to get the frame in which the panel is fixed.
The customized project panel extends JPanel class.
My need is, is there any way get the instance of the frame from the panel.
I tried , JFrame f = (JFrame) panel.getParent() and JFrame f = (JFrame) SwingUtilities.getRoot(panel); but they return only null value.
Please help me on this..
REgards