Forum: Java Aug 13th, 2009 |
| Replies: 19 Views: 544 Where does <condition> come from? If its never cleared then the false logic won't be executed! |
Forum: Java Aug 13th, 2009 |
| Replies: 19 Views: 544 gFlag is global.
In your event handler for mouse, set gFlag=false;
Thread falls out of while loop upon gFlag being false then exits.
There will be micro-delay between the flag being set and... |
Forum: Java Aug 13th, 2009 |
| Replies: 19 Views: 544 bool gFlag = true;
Event sets flag to false, and causes thread to fall out of loop!
Simple but effective!
// while (true){
while ( gFlag ){ |
Forum: Java Aug 7th, 2009 |
| Replies: 5 Views: 350 I'm not fluent in Java but threads are typically pre-emptive. Higher priority threads pre-empt lower priority threads. Threads of same priority are at the mercy of the tasking system.
One thought... |
Forum: Java Jul 17th, 2009 |
| Replies: 7 Views: 374 I'm rusty with Java but...
Watch your [] positioning. Also array is an int [] not a class!
But you have array.length
BubbleSort( array[], length );
public class BubbleSort
{
// ... |
Forum: Java Jul 7th, 2009 |
| Replies: 10 Views: 530 Post your entire code! Errors can be misleading without seeing everything in context!
For example if x is an integer or a double it can cause a problem with that printf. The fact that it was... |
Forum: Java Jul 6th, 2009 |
| Replies: 10 Views: 530 |
Forum: Java Jul 2nd, 2009 |
| Replies: 10 Views: 530 Ahem!
Given only radius gives you all the other data. No need to input.
Circumference = 2 * PI * r
Area = PI * r * r
etc.
I'm also assuming your x is entered as a Floating-Point value. |
Forum: Java Jul 2nd, 2009 |
| Replies: 6 Views: 382 for (int j = 0; j < 6; j++)
{
x = alignCoord[ j ][0];
y = alignCoord[ j ][1];
print x,y coordinates
} |
Forum: Java Jul 1st, 2009 |
| Replies: 6 Views: 382 based upon your description....
int alignCoord[6][2];
int index = 0;
public void mouseClicked(MouseEvent e)
{
if (index < 6) |
Forum: Java Jul 1st, 2009 |
| Replies: 6 Views: 382 Without a structure...
It is unclear what you want! You have a 10x10 array and you want to count everytime that area of the screen is clicked in the cell corresponding to that area, or merely... |