Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

JDialog to appear in Windows Taskbar

Thread view: 
RVince - 21 Aug 2007 15:46 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
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/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.