GIDForums  

Go Back   GIDForums > Computer Programming Forums > Java Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Aug-2006, 06:55
j2me j2me is offline
New Member
 
Join Date: Aug 2006
Posts: 8
j2me is on a distinguished road

Threads & draw image


i have a picture that after the user press on the right bottom i need to call to the internet in order to get new data but after i run a thread in order to get new data - my main program not wait fot this thread and call to the internet to get data whan the x and y have an old values - how can i make that the main thread will wait for this thread so the data i will recive will be the new pixcles that is in the right side of the picture?

  #2  
Old 30-Aug-2006, 10:00
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,233
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: threads & draw image


see join() in the thread class.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #3  
Old 30-Aug-2006, 10:43
j2me j2me is offline
New Member
 
Join Date: Aug 2006
Posts: 8
j2me is on a distinguished road

problem in the code - always in sleep


Quote:
Originally Posted by TurboPT
see join() in the thread class.
//this is my thread:
public class threadMoveRight implements Runnable{
Storeroom sto = new Storeroom();
String url;
Image image1;
boolean flag;

public threadMoveRight(String purl,Image pImage) {
this.url = purl;
this.image1 = pImage;
}

public void run() {
searchData();
flag = true;
}

}
//and after the user press on right he go to this code :
if (sto.doINeedConection){
while (sto.flag==false){
sleep();
}
}
repaint();
//the result:
//the program stay a lot of time in the sleep
  #4  
Old 30-Aug-2006, 10:55
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,233
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: threads & draw image


Where/how do you start (or call) the thread?
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with a console menu system BullBuchanan C++ Forum 6 20-Aug-2006 14:46
loading image asal FLTK Forum 5 24-Feb-2006 11:43
GIM gidedit - a fltk fluid resize project cable_guy_67 FLTK Forum 2 01-Jun-2005 15:00
Checking source codes of image, audio and video files onauc C Programming Language 5 26-Feb-2005 21:47
Apache2 config issues monev Apache Web Server Forum 2 28-Jun-2004 06:19

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:39.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.