GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Urgent help needed in this code..it involves threads! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Urgent help needed in this code..it involves threads!" Watch "Urgent help needed in this code..it involves threads!" New topic
Author

Urgent help needed in this code..it involves threads!

Komal Arora
Ranch Hand

Joined: Sep 30, 2010
Posts: 91


OK! So this is a parking lot application i have created. pasting the enter GUI code would be a waste and therefore i am pasting only that part of code in which i am getting a problem.
Right, So i have two threads running, one to remove a car from the parking lot and one to park a car in the parking lot. The code is running just fine and i get the output at the console as well. Now i have used a swing GUI which has a jtextField for every parking space. What i want is that the textfield for the corresponding parking space sets its text to "Car parked" automatically. For that i have a
AutoCarParkedEditor which is shown in bold in the Park() method. However, The text in not getting set in the text boxes even though i am getting everything on the console. I know this is some thread issue because the GUI has a thread and i have created two threads as well. Can anybody tell me how to resolve this problem so the AutoCarParkedEditor method works? i need a solution urgently so any help would be great. thanks



OCPJP
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

Please EaseUp. There is no such thing as urgent around here. Also, please UseAMeaningfulSubjectLine.

Have you read and understood Concurrency in Swing?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Komal Arora
Ranch Hand

Joined: Sep 30, 2010
Posts: 91

Rob Spoor wrote:Please EaseUp. There is no such thing as urgent around here. Also, please UseAMeaningfulSubjectLine.

Have you read and understood Concurrency in Swing?


OK. Sorry for writing like that. Actually i had to submit the assigment on that day itself and i had just one day to code!
Anyways, the problem has been solved. I studied concurrency in swing properly and i solved the problem.

Will use meaningful subject lines from now onwards.

Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2383
    
  28

Wasn't there a parking lot problem posted here few days ago? SOunds like multiple people from your class post here

ETA: BAH!!! the thread was started by yourself !!!. SOmeone even posted a solution, but you never showed up in the thread. The least you can do before posting a "urgent" question is go through your own posts
Komal Arora
Ranch Hand

Joined: Sep 30, 2010
Posts: 91

Yes i started that topic and with reference to the solutions given there only i coded. I got a problem in the code and thus asked.
i guess i should have posted this code in that thread only. I've never got such responses in a topic
anyways, will keep in mind all these things when i post next time.
 
 
subject: Urgent help needed in this code..it involves threads!