| ECS Home Automation and Security Archives |
| Subject: From: Date: | Re: [ecs] looking for some Java expertise (large menu frames
taking a Mark Gilmore Wed, 21 Feb 2007 12:05:36 -0500 |
hi jim,
that's *very* interesting.
i just tried it on another PC and it worked great.
so unless i hear different, i guess we can assume that this is
problem is **specific to my pc**.
thanks !
At 11:58 AM 2/21/2007, you wrote:
>I added these lines:
> System.out.println("Display frame");
> System.out.println(System.currentTimeMillis());
> jframe.setVisible(true); // display it (takes FOREVER)
> System.out.println(System.currentTimeMillis());
> System.out.println("Wait 5 seconds");
>
>Create frame
>Display frame
>1172076724593
>1172076726343
>
>
>Does not seem so long.....
>
>Java jre1.5.0_06
>On Windows XP SP2
>-jim
>
>Mark Gilmore wrote:
>>hi everyone,
>>i have recently noticed that *all* JAVA menu frames that contain a
>>lot of elements (over 200 or so)
>>can take a REALLY long time to display.
>>specifically, it is the Frame.setVisible(true) call that is the culprit.
>>the delay is proportional *only* to the number of elements in the frame.
>>it happens with both normal Frames and JFrames.
>>it happens in both Applets and stand-alone pgms.
>>
>>this can be seen in 3 places:
>> 1) click the value of an Integer Object
>> FireFox:
>> The *initial* display can take as long as
>> *30 seconds*
>> During this time,
>> \WINDOWS\system32\rundll32.exe is pegging the CPU AT 98+%
>> What this DLL has to do with a
>> JAVA menu is beyond me (GatesWare).
>> Thereafter, it takes 2-3 seconds
>> I.E.:
>> There is no long delay on 1st display (as
>> with FireFox)
>> It takes 2-3 seconds every time
>> (acceptable, but see #2).
>>
>> 2) if you have a lot of objects (i have 390), click the
>> ADD button in an ECS Page:
>> FireFox: It takes 10+ seconds to display the
>> Object menu every time
>> (rundll32.exe does not seem to come into
>> play for this one)
>> IE: same as FireFox
>>
>> 3) compile/run the JAVA pgm below.
>> This is a minimal pgm that reproduces the problem.
>> It takes 14 seconds to display a frame containing 500 labels.
>>
>>any theories or suggestions would be greatly appreciated !
>>i would also like to know who is (or is not ?) having similar problems.
>>
>>thanks,
>>Mark Gilmore
>><http://OmnipotenceSoftware.com>http://OmnipotenceSoftware.com
>>423-745-0026
>>
>>
>>********************************************
>>TEST PGM:
>>import java.lang.*;
>>import java.awt.*;
>>import java.awt.Component;
>>import java.awt.Label;
>>import javax.swing.JFrame;
>>public class X
>> {
>> public static void main(String[] arg)
>> {
>> X1 x1 = new X1();
>> x1.main(arg);
>> }
>> }
>>class X1
>> {
>> public void main(String[] arg)
>> {
>> JFrame jframe = new JFrame("MenuLookDemo");
>> jframe.getContentPane().setLayout(new
>> FlowLayout(FlowLayout.CENTER, 2, 2));
>> int x;
>> System.out.println("Create frame");
>> Label lb[] = new Label[500]; // create frame
>> with 500 labels
>> for (x = 0; x < 500; x++)
>> {
>> lb[x] = new Label(Integer.toString(x));
>> jframe.getContentPane().add(lb[x]);
>> }
>> jframe.setSize(800, 400);
>> System.out.println("Display frame");
>> jframe.setVisible(true); // display it
>> (takes FOREVER)
>> System.out.println("Wait 5 seconds");
>> try {Thread.sleep(5000);}
>> catch (InterruptedException e0) {};
>> System.exit(0);
>> }
>>}
>>
>>Mark Gilmore
>><http://OmnipotenceSoftware.com>http://OmnipotenceSoftware.com
>>
>
>--
><mailto:jim@willeke.com>-jim
>Phone: 419.564.7692
>Email: <mailto:jim@willeke.com>jim@willeke.com
>IM: <mailto:jim@willeke.com>jim@willeke.com (on MSN)
>IM: <mailto:jim@willeke.com>jwilleke@gmail.com (on GOOGLE)
>IM: jwilleke (on Yahoo)
>IM: jeemster (on AIM)
>My LinkedIn:
><http://www.linkedin.com/in/jwilleke>http://www.linkedin.com/in/jwilleke
Mark Gilmore
http://OmnipotenceSoftware.com