Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JDialog.setVisible(true); taking several seconds to display

Reply
Thread Tools

JDialog.setVisible(true); taking several seconds to display

 
 
Dave Brown
Guest
Posts: n/a
 
      07-09-2005
Hi All,

Just wondering if anyone can give me any pointers as to why my dialog is
taking too long to display, its a very basic dialog, a dozen textboxes
and labels and thats it. I'm displaying it modally with this code...

private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {

LocationDLG dlg;
dlg = new
LocationDLG((javax.swing.JFrame)this.getTopLevelAn cestor(),true);
if (dlg.doModal()) {
RefreshLocations();
}
dlg.dispose();
}


in dlg.doModal() is the code that sets visible to true ;

public boolean doModal() {
setVisible(true);
return retval;
}


once it gets to the setvisible line, debugging over that is what takes
up to 6 seconds. Far too long just for a simple dialog it seems.

Any advice appreciated.


Thanks,

Dave.
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      07-09-2005
On Sat, 09 Jul 2005 10:59:37 +0100, Dave Brown wrote:

> Just wondering if anyone can give me any pointers as to why my dialog is
> taking too long to display, its a very basic dialog, a dozen textboxes
> and labels and thats it. I'm displaying it modally with this code...
>
> private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {
>
> LocationDLG dlg;
> dlg = new
> LocationDLG((javax.swing.JFrame)this.getTopLevelAn cestor(),true);


You can prepare the dialog after the GUI becomes visible in a
separate thread in the background. That way, it can be ready
to setVisible(true) when the user requires it.

> if (dlg.doModal()) {
> RefreshLocations();


What does that do? 100,000 separate D/B transactions? [1]

> once it gets to the setvisible line, debugging over that is what takes
> up to 6 seconds.


'debugging over that is what takes..'?? What does that mean?

>..Far too long just for a simple dialog it seems.
>
> Any advice appreciated.


- Supply a self contained (SHORT) example that demonstrates
this behaviour.
- Supply said example to the GUI experts on c.l.j.gui.

[1] OK - cheap shot given it is called after the dialog
returns. I just couldn't resist.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
 
 
 
Dave Brown
Guest
Posts: n/a
 
      07-09-2005
Thanks for replying Andrew,

The building of dialog is almost instanteanous, The delay is just on
the setVisible();

I havent used the c.l.j.gui newsgroup before, didnt realise it was there
so I've posted on there.

Thanks again,

Dave.


Andrew Thompson wrote:
> On Sat, 09 Jul 2005 10:59:37 +0100, Dave Brown wrote:
>
>
>>Just wondering if anyone can give me any pointers as to why my dialog is
>>taking too long to display, its a very basic dialog, a dozen textboxes
>>and labels and thats it. I'm displaying it modally with this code...
>>
>> private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {
>>
>> LocationDLG dlg;
>> dlg = new
>>LocationDLG((javax.swing.JFrame)this.getTopLevel Ancestor(),true);

>
>
> You can prepare the dialog after the GUI becomes visible in a
> separate thread in the background. That way, it can be ready
> to setVisible(true) when the user requires it.
>
>
>> if (dlg.doModal()) {
>> RefreshLocations();

>
>
> What does that do? 100,000 separate D/B transactions? [1]
>
>
>>once it gets to the setvisible line, debugging over that is what takes
>>up to 6 seconds.

>
>
> 'debugging over that is what takes..'?? What does that mean?
>
>
>>..Far too long just for a simple dialog it seems.
>>
>>Any advice appreciated.

>
>
> - Supply a self contained (SHORT) example that demonstrates
> this behaviour.
> - Supply said example to the GUI experts on c.l.j.gui.
>
> [1] OK - cheap shot given it is called after the dialog
> returns. I just couldn't resist.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Seconds to X Hours Y Minutes Z Seconds? 00_CP_D12 ASP .Net 3 02-22-2008 10:37 AM
convert seconds to hours:minutes:seconds `p Ruby 7 12-14-2005 03:32 PM
1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds Michael Tan Ruby 32 07-21-2005 03:23 PM
Convert seconds to minutes and seconds tshad ASP .Net 7 03-11-2005 11:27 PM
Converting seconds to (Days, Hours, Minutes, seconds) Stu C Programming 7 03-07-2005 08:44 AM



Advertisments