Steve
Originally posted by Patrick Brahami:
So it comes to the question you raised yourself- what is less CPU consuming? I mean, at one approach I have many threads sleeping, in the other I'll have one thread checking time every ~15mints.
In my case, I'll have many events pending, and accuracy is not so important. [I can suffice with 15mints, even each 30mints]
Elegance-wise the first approach sounds better to me, any way I can find CPU difference between the two approaches?
Steve
Steve
Steve
Originally posted by Patrick Brahami:
More Follow up question.
This time I've got a design problem.
I want to execute some code right after a scheduled event takes place.
Now all the options I can think about are not so elegant.
First option I have in mind is adding the code into the TimerTask of the other event, but the two are different logic business, I wouldn't want to bind them together in a same TimerTask.
Second option I think of is scheduling in a different TimerTask the other event for a little later.
But that won't cause the code to happen right after necessarily from what I understand. [because of JVM / Garbage Collection issues]
Is there a more elegant way to do this I don't know about?
[ October 14, 2008: Message edited by: Patrick Brahami ]
Steve
Originally posted by Patrick Brahami:
I see. Once again problem solved, thank you!
Got more follow up questions, hope they're last ones, this time abit unrelated for I'm at the final stage - GUI, and I'm trying Swing and Netbeans GUIBuilder for first time. [Usually it's SWT &Eclipse]
Originally posted by Patrick Brahami:
So I've got some technical questions, hope you could help me with.
My program downloads something from the web, and I give it only a name of file - and it automatically stores it in a default directory, the NetBeansProject one, inside my current project.
What will happen if I export the program? will it save it in the program folder?
Originally posted by Patrick Brahami:
If so, is there a way to acquire that default root as a string somehow?
for I use run.exec(openingSoftwareLocation,/s ,filetoOpenlocation)
and I want to enter the location of the currently downloaded file.
I tried adding a relative path to the command too, but it doesn't work.
Is there a way enter a relative path to the filetoOpenlocation?
or can I retrieve the default directory as a string somehow?
Originally posted by Patrick Brahami:
Oh and last thing, is there a way to close a form without .dispose()?
Because I have my main form, with an inner class of another form in it.
When I open that form, and execute dispose method, it closes both forms for some reason.
Even if I click this.dispose() within the inner class(which is a JForm) it closes the main form. Why is that? How can I refer to my inner class object from within it?
Oh, also, even the windows 'X' sign of the new form closes both form. Weird.
Once again - thanks in advance!
Steve
Don't get me started about those stupid light bulbs. |