I have an application whose only gui is to invoke a JDialog and
display it. On Windows machines, I need to have an the usual taskbar
button, typically at the bottom of the screen on Windows systems,
appear. It seems that simply invoking a modal JDialog wont put
anything into the Windows taskbar, and thus if a user puts another
Window in front of this JDialog -- they can even forget it's there!.
Does anyone know of a workaround to this? Thanks, R.Vince
Knute Johnson - 21 Aug 2007 18:29 GMT
> I have an application whose only gui is to invoke a JDialog and
> display it. On Windows machines, I need to have an the usual taskbar
[quoted text clipped - 4 lines]
>
> Does anyone know of a workaround to this? Thanks, R.Vince
As of 1.6 that is easy to do. Create a JDialog with the
DialogModalityType of TOOLKIT_MODAL.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class test8 {
public static void main(String[] args) {
Runnable r = new Runnable() {
public void run() {
JDialog d = new JDialog(
(Frame)null,Dialog.ModalityType.TOOLKIT_MODAL);
d.setTitle("title");
d.setSize(300,200);
d.setVisible(true);
System.exit(0);
}
};
EventQueue.invokeLater(r);
}
}

Signature
Knute Johnson
email s/nospam/knute/
RVince - 21 Aug 2007 18:37 GMT
Thanks Knute,
Unfortunately I have to be 1.4.2 compatible here. -R. Vince
Knute Johnson - 21 Aug 2007 19:01 GMT
> Thanks Knute,
>
> Unfortunately I have to be 1.4.2 compatible here. -R. Vince
Why would you want to use a compiler that in a very few months will be
obsolete?
Use a Frame/JFrame instead of a dialog.

Signature
Knute Johnson
email s/nospam/knute/