Re: Swing/Fireworks test does not work

  • From: Kirill Grouchnikov <kirillcool@yahoo.com>
  • To: users@trident.kenai.com
  • Subject: Re: Swing/Fireworks test does not work
  • Date: Mon, 8 Feb 2010 23:23:24 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=dVnxhs4HNFV84fmVkmGt7ABgsRpRpT2UJKzGqgJG4nCKOvnhryDdOAdXp7Y4+L+CsrI1fIXOoCwy6qCKuD7QzNEhmsg9qtPMDhjYzjh+HMEccWQV1O1psqyU5HnV5oACyJZnpYJFGRBJWAJMfRrdaaB4N9ZZkBu2wSb1JqKQvWQ=;

It's indeed a little bit awkward. Until i think of a better way to generate bunches of explosions, perhaps this workaround is OK:

                while (true) {
                    if ((mainPanel.getWidth() > 0)
                            && (mainPanel.getHeight() > 0)) {
                        addExplosions(5);
                    } else {
                        // wait until the panel is ready
                        try {
                            Thread.sleep(500);
                        } catch (Exception exc) {
                        }
                    }
                }



From: cowwoc <cowwoc@bbs.darktech.org>
To: users@trident.kenai.com
Sent: Sat, February 6, 2010 2:42:54 PM
Subject: Re: Swing/Fireworks test does not work

I finally got around to looking at this. It was caused by the following code sniplet:

        new Thread() {
            @Override
            public void run() {
                while (true) {
                    if ((mainPanel.getWidth() > 0)
                            && (mainPanel.getHeight() > 0)) {
                        addExplosions(5);
                    }
                }
            }
        }.start();

Initally the condition is false, leading this thread to starve other threads. In my case, this gets into an endless loop. Inserting a sleep statement or any other sort of delay per iteration solves the problem for me but obviously this needs to be cleaned up in a more elegant way. I suggest you run FindBugs on the codebase. I suspect it'll find other problems.

Gili

On 19/12/2009 6:49 PM, Kirill Grouchnikov wrote:
The only thing i can think of is to debug the application locally. Specifically, the Fireworks constructor creates a JPanel which paints all the visuals in its overriden paintComponent(). The volleys are created in addExplosions() method and are animated by the matching timeline scenarios.

Since i don't have access to a 64 bit Windows box, i cannot do this myself.

Thanks
Kirill


From: cowwoc <cowwoc@bbs.darktech.org>
To: users@trident.kenai.com
Sent: Sat, December 19, 2009 1:17:21 PM
Subject: Re: Swing/Fireworks test does not work

Kirill Grouchnikov wrote:
> I don't have a 64 bit Windows box. Is this a windows box, or a different OS?

    Yes, Windows7 Ultimate 64-bit.

> Can you run other Swing applications (not from Trident) under the same 64-bit JVM?

    Yes. Other Swing applications run just fine. Only applications with native code fails if you try mixing 32-bit native DLLs with the 64-bit JVM.

Gili





Re: Swing/Fireworks test does not work

cowwoc 02/06/2010

Re: Swing/Fireworks test does not work

Kirill Grouchnikov 02/09/2010

Re: Swing/Fireworks test does not work

Kirill Grouchnikov 02/09/2010
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20100312.9442df5)
 
 
loading
Please Confirm