Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1926 > unrolled thread

Processing dialog

Started by"kvram" <kvram@THRWHITE.remove-dii-this>
First post2011-04-27 15:36 +0000
Last post2011-04-27 15:36 +0000
Articles 5 — 4 participants

Back to article view | Back to comp.lang.java.gui


Contents

  Processing dialog "kvram" <kvram@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
    Re: Processing dialog "Thomas Fritsch" <thomas.fritsch@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
      Re: Processing dialog "kvram" <kvram@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
    Re: Processing dialog "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
    Re: Processing dialog "Nigel Wade" <nigel.wade@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000

#1926 — Processing dialog

From"kvram" <kvram@THRWHITE.remove-dii-this>
Date2011-04-27 15:36 +0000
SubjectProcessing dialog
Message-ID<1183297572.742968.311580@n60g2000hse.googlegroups.com>
  To: comp.lang.java.gui

Hello!

I wonder how to do the following:

i have a function connected to a button. works fine.
But this function is very heavy in calculating and it
locks up the user interface. So i thought to run the
function inside a thread. (that i have not done yet
but i will do). However, i need a simple JDialog kind
of thing which pops up in the middle of screen to tell
the user "Processring.." and disapears as soon as the
function is done. I wonder what is the best method of
doing it in Swing? what is the best class to use and how
to interact with the dialog to make it disappear from the
screen upon function finish.

thanks for your time/thoughts,
kave

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#1927

From"Thomas Fritsch" <thomas.fritsch@THRWHITE.remove-dii-this>
Date2011-04-27 15:36 +0000
Message-ID<f68bot$a0h$01$1@news.t-online.com>
In reply to#1926
  To: comp.lang.java.gui
kvram@passagen.se wrote:
> i have a function connected to a button. works fine.
> But this function is very heavy in calculating and it
> locks up the user interface. So i thought to run the
> function inside a thread. (that i have not done yet
> but i will do). However, i need a simple JDialog kind
> of thing which pops up in the middle of screen to tell
> the user "Processring.." and disapears as soon as the
> function is done. I wonder what is the best method of
> doing it in Swing? what is the best class to use and how
> to interact with the dialog to make it disappear from the
> screen upon function finish.
Sounds like you need Swings's JProgressBar.
There is a chapter (with examples) in the Sun's Java tutorial:
"How to Use Progress Bars"
http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

-- 
Thomas

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1928

From"kvram" <kvram@THRWHITE.remove-dii-this>
Date2011-04-27 15:36 +0000
Message-ID<1183299758.310221.282370@q69g2000hsb.googlegroups.com>
In reply to#1927
  To: comp.lang.java.gui
On 1 Juli, 15:55, Thomas Fritsch <i.dont.like.s...@invalid.com> wrote:
> k...@passagen.se wrote:
> > i have a function connected to a button. works fine.
> > But this function is very heavy in calculating and it
> > locks up the user interface. So i thought to run the
> > function inside a thread. (that i have not done yet
> > but i will do). However, i need a simple JDialog kind
> > of thing which pops up in the middle of screen to tell
> > the user "Processring.." and disapears as soon as the
> > function is done. I wonder what is the best method of
> > doing it in Swing? what is the best class to use and how
> > to interact with the dialog to make it disappear from the
> > screen upon function finish.
>
> Sounds like you need Swings's JProgressBar.
> There is a chapter (with examples) in the Sun's Java tutorial:
> "How to Use Progress Bars"http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
>
> --
> Thomas


Exatctly what i needed! Thanks a lot!
kave

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1929

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 15:36 +0000
Message-ID<qglf83h61jd5ii3cm82d9lhffuekt4rugd@4ax.com>
In reply to#1926
  To: comp.lang.java.gui
On Sun, 01 Jul 2007 06:46:12 -0700, kvram@passagen.se wrote, quoted or
indirectly quoted someone who said :

>However, i need a simple JDialog kind
>of thing which pops up in the middle of screen to tell
>the user "Processring.." and disapears as soon as the
>function is done.

Just change the cursor.  It will be much faster and more traditional.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1930

From"Nigel Wade" <nigel.wade@THRWHITE.remove-dii-this>
Date2011-04-27 15:36 +0000
Message-ID<f6ad4j$bjf$1@south.jnrs.ja.net>
In reply to#1926
  To: comp.lang.java.gui
 kvram@passagen.se wrote:

> 
> Hello!
> 
> I wonder how to do the following:
> 
> i have a function connected to a button. works fine.
> But this function is very heavy in calculating and it
> locks up the user interface. So i thought to run the
> function inside a thread. (that i have not done yet
> but i will do). However, i need a simple JDialog kind
> of thing which pops up in the middle of screen to tell
> the user "Processring.." and disapears as soon as the
> function is done. I wonder what is the best method of
> doing it in Swing? what is the best class to use and how
> to interact with the dialog to make it disappear from the
> screen upon function finish.
> 
> thanks for your time/thoughts,
> kave

If you are using Java 1.6 (or should it be 6?) then SwingWorker is one solution.
Post a dialog of some kind prior to initiating the worker thread, and have the
SwingWorker.done() method take it down.

http://java.sun.com/docs/books/tutorial/uiswing/concurrency/worker.html

-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
            University of Leicester, Leicester, LE1 7RH, UK 
E-mail :    nmw@ion.le.ac.uk 
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web