🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #114

Re: loading screen for Java application

#114
From: tom
Date: Wed, 08 Feb 2006 00:44
79 lines
3482 bytes
Hi Paul,

Thanks for your suggestion. I do not need a progress dialog. I just want to 
use a real simple splash screen to display some text while the java 
application is loading.
I tried JDialog and JWindow; however, I can not get the text to display on 
the contentPane unless I set the setModal to true, which it's kind of 
defeating the purpose.

Once I set the setModal to true, it takes over the current process thread. 
It will not continue until I manuall close the dialog.

Am I missing something here? Please take a look at the following code snip.


thanks,

Tom

code snip:

        String status = "Loading... Please wait...";
        JDialog jwin = new JDialog();
        JPanel jpanel = new JPanel();
        jpanel.add(
            new JLabel("Now Loading...",
                SwingConstants.CENTER));

        jpanel.setVisible(true);
        jwin.getContentPane().add(jpanel, BorderLayout.CENTER);


       //jwin.setModal(true); /* visible only if enabled */
        jwin.setTitle(status);
        jwin.setResizable(false);
        jwin.setBackground(Color.lightGray);
        jwin.setBounds(400, 400, 250, 1

       //Loading application here...
        jwin.setVisible(false);
        jwin.dispose();

"Paul Furbacher [TeamB]" <pfurbacher@mac.com> wrote in message 
news:43e81693$1@newsgroups.borland.com...
> tom wrote:
>
>> Does anyone know how to create 'build progress' screen similar to 
>> Jbuilder uses when it compiles/makes the application?  It displays a 
>> JDialog with compiling messages and closed after finished compiling the 
>> application.
>
> The following article may provide insight:
>
>   http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html
>
> I'm sure there are other examples; try Googling
>
>   swing worker thread examples progress dialog
>
> Here's one hit:
>
>
> http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
>
>
> -- 
>
>
> Paul Furbacher (TeamB)
>
>   Save time, search the archives:
>        http://info.borland.com/newsgroups/ngsearch.html
>
>   Is it in Joi Ellis's Faq-O-Matic?
>        http://www.visi.com/~gyles19/fom-serve/cache/1.html
>
>   Finally, please send responses to the newsgroup only.
>   That means, do not send email directly to me.
>   Thank you. 
Technical Details
Message-ID: <43e93e25$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!switch.ch!newsfeed.inode.at!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail
References: <43e7dbf3@newsgroups.borland.com> <43e81693$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,3d616149f9b71a58
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "tom" <zhangx@gaia.ecs.csus.edu>
From: "tom" <zhangx@gaia.ecs.csus.edu>
Newsgroups: borland.public.jbuilder.java.swing
References: <43e7dbf3@newsgroups.borland.com> <43e81693$1@newsgroups.borland.com>
Subject: Re: loading screen for Java application
Date: Tue, 7 Feb 2006 16:44:49 -0800
Lines: 81
Organization: java developer beginner
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 136.200.198.187
Message-ID: <43e93e25$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1139359269 136.200.198.187 (7 Feb 2006 16:41:09 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!switch.ch!newsfeed.inode.at!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail