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:26:56 -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=0dbJVEjTq0GF9Em7JM7j6wktYzIjDU5BuM9K0d5JwMbKQ7jFUtbXF7GMwtg0zjOUUxsmX/ew7I+l9Pfy5tUS4UE+ZgZyTxLETFmSag/+CnzG22cba/oaxWPBbDDJjK+WhHd9H7htSJhbaOQ2zNEfHOuFWGa5RuWZyZwt0Oi30ic=;
Or maybe just listen until the panel has nonzero size and then start the thread:
mainPanel.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
if ((mainPanel.getWidth() == 0) || (mainPanel.getHeight() == 0))
return;
new Thread() {
@Override
public void run() {
while (true) {
addExplosions(5);
}
}
}.start();
}
});
mainPanel.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
if ((mainPanel.getWidth() == 0) || (mainPanel.getHeight() == 0))
return;
new Thread() {
@Override
public void run() {
while (true) {
addExplosions(5);
}
}
}.start();
}
});
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.
ThanksKirill
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
| cowwoc | 02/06/2010 | |
| Kirill Grouchnikov | 02/09/2010 | |
|
Re: Swing/Fireworks test does not work |
Kirill Grouchnikov | 02/09/2010 |






