JDialog in Windows
Hi
I am poping up a JDialog from Frame object.
In linux when i have not set the parent of this JDialog and modal false, then a new process ( or thread ) is shown on task bar.
But in windows only one process , that is Frame is shown at task bar .
How to solve this problem.
thanks
--sunny jain--
[338 byte] By [
sunnyjaina] at [2007-11-27 10:31:01]

# 1
The task bar shows not processes or threads, but windows. This sounds like a difference between Linux and Windows behavior. What makes you consider it "a problem"?
Don't use non-parented JDialogs? What's the difference between a parentless, non-modal dialog and a frame? Not much, really.
# 2
Hi
Let me explain the entire problem.
In windows ,JFrame when displayed creates a window at task bar.
But when JDialog pops up from this JFrame it does not create a new window at
taskbar.
This JDialog is parent less and non-modal.
Now when i move this JDialog out of sight, as no extra window is displayed their is
no way to see that a Dialog is also open.
Thats why i consider this behavior as problem .
I have requirement that similar to linux , a new window should be displayed for
JDialog which pops up from Jframe in Windows.
How to do this.
thanks
--Sunny Jain--
# 3
give it a dummy parent
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Testing
{
public void buildGUI()
{
//JDialog d = new JDialog();
JDialog d = new JDialog(new JFrame(){public boolean isVisible(){return true;}});
d.setSize(400,300);
d.setLocationRelativeTo(null);
d.setVisible(true);
d.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
System.exit(0);
}
});
}
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable(){
public void run(){
new Testing().buildGUI();
}
});
}
}