JOptionPane.getWindowForComponent(parent)
Window is a superclass of Frame and Dialog. And in 1.6 there is
a constructor of JDialog that accept Window as owner,
but I can't use it!
JOptionPane.getWindowForComponent()
is a static method that is not public, and I don't understand the reason!
Because when I create a JDialog over a frame or over another dialog, I must use
a method like this:
public void openDialog(Component parent) {
if (parent instanceof JDialog)
jDialog = new JDialog((JDialog)parent);
else {
Frame frame = JOptionPane.getFrameForComponent(parent);
jDialog = new JDialog(frame);
}
....
but using that method could be simple and better:
public void openDialog(Component parent) {
jDialog = new JDialog(JOptionPane.getWindowForComponent(parent));
.....
What is your opinion?
Should this method made public?

