posted 23 years ago
Thanks,
I can do that, no problem with extending, but problem stays with JDialog itself. If we look at API of JDialog, it does not support IconImage methods, only frames and other components.
So extension of JDialog would not help, I Think....
However for timebeing what I have done is, I have passed a parent frame with icon to the current frame(to be modaled), Then setting contentpane of this dialog to be contentpane of the current frame. I think following should make this understand better.
1) Created a parent frame-A with some menus and buttons and so on, setting IconImage as well.
2) Created a JDialog with "new JDialog(frame-A);
3) Created another frame-B with tabbed panes, to be modaled.
4) Introduced a method called "void Display(JDialog)
5) Called this method from frame-A.
6) Replaced Contentpane of Dialog in Display() method, with contentpane of frame-B, usinf JDialog.setContentPane(...) method.
7) pack() and show() dialogs.
This really worked and also provided flexibility of using JFrame features in modal Dialog/Frame.
I think this is got to be the way round unles you guys can suggest better option. At least this works great.
Thanks again all, keep posting.
Nilesh