The main problem with JDialog is that it is not appear by default in taskbar. (You know it is where application are at the bottom on your screen, near the Start menu.) Further more I like my JDialog also got a identified icon.
The first time I search for resolving this two problems, I found one solution for each problem but they don’t work together. After a few tries, I found the best way to do it.
This is my JDialog’s constructor :
public MasterPasswordForm() { super(null,ModalityType.TOOLKIT_MODAL); setIconImage(new ImageIcon( getClass().getResource("/images/icon.gif") ).getImage()); setLocationRelativeTo(null); initialize(); jDialog = this; }
The call to super’s contructor make application appear in taskbar.
The setIconImage’s function do for my icon !
The setLocationRelative to null it is for centering my Jdialog !
And this is a perfect integrated JDialog !








No User Responded in " Swing Tips : JDialog with special icon and in taskbar "
Leave A Reply Below