J
javaseeker
I was just checking out a few calls to different Applets using
reflection.
I could manage a call to Classes which extends JPanel but i couldnt
manage to call Classes which extend JDialog(the parent window
extending JPanel) .The call is as follows.
Class c = Class.forName(className) ; // Got the class name by
reflection
DialogInterface dialog = (DialogInterface)c.newInstance(); //
Implementing Dialog interface
dialog.setProperties (props) ; // Let them know the properties
in the session
dialog.setCallback (this) ; // How they get back to us after
operation in new screen
getSplitPane().add((java.awt.Component)dialog, "right") ; // Add the
panel to the right hand pane using split pane
dialog.init (); // Let the panel do it's stuff
The error that comes up is :
java.lang.IllegalArgumentException: adding a window to a container.
Hope have given the problem statement properly(any extra info needed)
Maybe my concepts may not be clear.Any ides where i went wrong?
reflection.
I could manage a call to Classes which extends JPanel but i couldnt
manage to call Classes which extend JDialog(the parent window
extending JPanel) .The call is as follows.
Class c = Class.forName(className) ; // Got the class name by
reflection
DialogInterface dialog = (DialogInterface)c.newInstance(); //
Implementing Dialog interface
dialog.setProperties (props) ; // Let them know the properties
in the session
dialog.setCallback (this) ; // How they get back to us after
operation in new screen
getSplitPane().add((java.awt.Component)dialog, "right") ; // Add the
panel to the right hand pane using split pane
dialog.init (); // Let the panel do it's stuff
The error that comes up is :
java.lang.IllegalArgumentException: adding a window to a container.
Hope have given the problem statement properly(any extra info needed)
Maybe my concepts may not be clear.Any ides where i went wrong?