Need so somehow come back from reading a port to do other things.

I got a class that runs a GUI to open a user's webcam and display the view. Then the class goes over to another class that reads from a serial port to display the speed frmo a GPS receiver on the port and display it on the GUI. Then I need the GUI to be ready for a user's input for start/stop as well. I'd post the code but it's kind of long, my problem is that once the focus goes over to the class that reads the serial port, it stays over there and the GUI doesn't load. It's splitting off to read the port from the constructor so it's the first thing done, how do I make the GUI and stuff load as well? Do I need to create a different thread and have them run concurrently? Then if I try to run getSpeed() from the thread running my GUI, will that get the speed currently pulled by the other thread that's reading the port?

All the blocking I/O should be done in separate threads. If they need to update the GUI they should do that via SwingUtilities.invokeLater().
Then if I try to run getSpeed() from the thread running my GUI, will that get the speed currently pulled by the other thread that's reading the port?If they refer to the same variable and you've taken care of synchronization.

Similar Messages

  • Satellite U400 wont turn on & when on wont come back from sleep mode

    I have a Satellite U400 and its a year and a few months old.
    In the last little bit it has been acting up, and it started with when the computer goes to sleep and goes to the black blank screen it will not come back from that.
    The only way to do anything is hold in the power key till it turns off and then turning it back on. This brings me to the warning screen I have turned my computer off incorrectly. It has been doings this for a few weeks and started randomly out of the blue.
    Then just today it wouldnt turn on at all, I was pressing the power key and the key itself would light up, and on the bottom right hand side the little lights would light up but wouldnt turn on, I kept pressing it over and over and over again and finally it did turn on. Once on I only used it for a few mins before turning off again and then would do the same thing, I kept pressing the bottom till it turned on. Its been on now and hasnt turned off again.
    Not to log ago I had to reformat my computer due to me forgeting my password and had locked myself out of the computer. About a week after that is when the issues started. I am not all that computer smart, to be honest, I do understand something things, I can follow step by step to do something.
    I really dont want to pay to have it fix I want to just do it myself and soon as its in great shape and never had any issues before.
    Does anyone have any idea what this could be, or why it could be?
    I am thinking about reformatting again as I am worried that didnt work out right the 1st time or something.
    Or if this is something that needs to be repaired does anyone have a clue on the cost of it?
    Thanks ^_^

    hi aev270,
    sounds like a serious problem to me.
    try the following: take out battery, cd-rom, hdd and try again.
    if it starts up without this components - you got lucky!
    this means it probably a software issue (but i dont think so - sorry)
    do you see the toshiba logo / bios messages? no - the you are in trouble.
    this strange behaviour could depend on many things: defektive components like ram or grafics... or (badest thing) the mainboard...
    if you have still warranty on it you should go to a servicepartner having the system checked.

  • I have just come back from morocco where my phone worked ok using the morroco network, but since returning to the uk I can't get it to pick up a signal from the 'Three' network, have tried resetting etc but still wont work, any suggestions

    I have just come back from morocco where my phone worked ok using the morroco network, but since returning to the uk I can't get it to pick up a signal from the 'Three' network, have tried resetting etc but still wont work, any suggestions

    banannaphone,
    Welcome to Apple Discussions.
    Quit Safari, find the com.apple.Safari.plist file in your Macintosh HD/Users/yourusername/Library/Preferences Folder, drag it to the Desktop, log out/in or restart and let us know what happens.
    ;~)

  • Just upgraded to OSX mavericks on macbook pro mid 2011 version. Having a big issue here that whenever my mac comes back from sleep, i.e after I open the lid, the screen flickers and there is an error of Finder not opening properly. Any fix to this?

    Just upgraded to OSX 10.9 mavericks on macbook pro mid 2011 version. Having a big issue here that whenever my mac comes back from sleep, i.e after I open the lid, the screen flickers and there is an error of Finder not opening properly. Any fix to this?

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

  • Problem to come back from sleep mode in Lenovo Thinkpad T400 using Windows XP

    Problem to come back from sleep mode  in Lenovo Thinkpad T400 using Windows XP. Each time closing the T400 lid and try to make the laptop into a sleep mode for some time, it does not properly come out of sleep mode. Login screen is able to see when opening the lid for the first time, but it only seen for a while before then a black screen on T400 Thinkpad appears. Sometime the hard drive activity can be shown also. And then, to come back I had only one option to hard re-boot.
    I tried Fn+F4 and power button once to come back but no use.
    Please provide me some solution for this?
    Thanks in Advance.

    oh sorry and its been closed inbetween uses. When i open it the keyboard doesn't light up and it makes no sound.

  • # of tab canvases dependant on the # of groups that come back from a query

    Hi,
         I'm trying to create a dynamic creation of blocks, and tab canvases dependant on the number of groups that come back from a query. If 4 groups come back then I desire 4 tabs with the appropriate data in each tab.

    Basically Forms is not intended to build screens programmatically but it is possible to kluj it. Here's what you could do.
    Create a form with (say) four tabbed canvases, enough to fill the display. Each canvas has its own block. Then you have video style buttons - Fwd, Bk, FFwd FBk - and just scroll the blocks across when the user clicks the button.
    Did you enjoy the use of the word "just"? Sounds easy, doesn't it? In practice, what you need is an array that ties the filter criteria to the canvas number. Then you shuffle the canvases by applying the appropriate WHERE clause using SET_BLOCK_PROPERTY and then executing a query.
    The problems with this are obvious and the same as any dynamically generated UI. It will perform badly (each navigation to a canvas will trigger a fresh query, plus there's the overhead of managing the stack). Also it is fragile: there's lots that can go wrong.
    So you need to ask yourself what it is you are hoping to achieve. Can you deliver the same business function some other way? As another poster has pointed out, this is just a glorified master-detail form - the filter criterion being the master. Building this as a classic two block master-detail Form is more straightforward and more robust.
    Regards, APC

  • Hey my air's screen is mess when it comes back from sleep. It is full of horizontal  colorful lines. However, it becomes ok when I restart it. What's wrong with it?

    Hey my air's screen is mess when it comes back from sleep. It is full of horizontal  colorful lines. However, it becomes ok when I restart it. What's wrong with it?

    Resetting PRAM may help.
    Reset PRAM.  http://support.apple.com/kb/PH4405

  • My Outlook prompts for password every time it comes back from sleep or started

    I've Microsot Outlook for MAC 2011, version 14.4.1 installed on my MAC Book Pro Retina Display with OS X Version 10.9.2 and everytime my outlook comes back from sleep or is started or there is a little fluctuation in Wifi signals, prompts me for my email password. I checked the option of save my passord, deleted all previous passwords from Keychain but it doesn't works, so please help. My email at my official domain (not free domains) address is configured perfectly and my send and received is working fine.

    I have that problem in Outlook, too. When I get the Yes/No dialog box, I simply click "No" and my machine continues to receive mail.
    It's most certainly a pain, but coming out of sleep, your network doesn't kick in for a minute or two. I don't think that it's really a bug in either OS X or Outlook: it just takes that minute or so for the network to wake up.
    Clinton

  • I have just come back from holiday and started my mac up and I have a white spot next to my Finder, Safari and Mail? why?

    I have just come back from holiday and started my mac up and I have a white spot next to my Finder, Safari and Mail? why?

    Are you talking about the indicator for open applications?
    If you're on Lion, it just reopened apps that where open when you shut it down.
    Regards,
    Captfred

  • HT4367 Whenever I try to rent a movie, Apple TV buffers and does not come back.  I am able to see other programs, but not able to rent movies.   And the movie charge still goes on my bill.

    Whenever I try to rent a movie, Apple TV buffers and does not come back.  I am able to see other programs, but not able to rent movies.   And the movie charge still goes on my bill.

    Apple TV uses iTunes. The reason you can't rent through your ATV is because you can't rent movies through iTunes Canada. Sadly, as this is a user-to-user forum, no one here would know when or if rentals will come to Canada.

  • HT3606 I have Mac OS X version 10.5.8 and so im wondering what is the next step i need to get. i have tried to get snow leopard and other things and not having any lukck . can any one help me out pls.

    I have Mac OS X version 10.5.8 and so im wondering what is the next step i need to get. i have tried to get snow leopard and other things and not having any lukck . can any one help me out pls.

    If your Mac meets these requirements:
    http://support.apple.com/kb/SP575
    then you can order a Snow Leopard disk and install it.
    http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
    Ciao.

  • Controlling how number fields come back from ADO

    Hi,
    I was wondering if it is possible to somehow control how number fields are returned from an ADO Recordset when using the Oracle ODBC driver?
    What I would like to do is to force all Number(8) columns in the DB to come back as ADO type integer - not adNumeric as they currently do....
    Thanks a lot!

    No, at that level of abstraction you don't have any control over it. Not sure if it is something you can map even at the API level as I think the driver is mapping them to SQL_C_NUMERIC.

  • Bluetooth turns off, needs restart to come back on

    I'm using a 17" Imac G5 w/ power pc processor, no isight. It came with bluetooth installed at the factory. Software is 10.4.11. I recently bought a new wireless aluminum keyboard and wireless mighty mouse (on ebay, boxes were sealed). They worked fine for the first month or so. Now, they started randomly losing connection, but not really when I am using them. It seems that when the screen saver comes on it causes the issue.
    I'll go to the bluetooth set up page both trough system prefs, or through the bluetooth icon in the upper right, so I can rediscover them, or delete them and pair again. However, when I click to add new device, both after having deleted them and without, and it gives me a message that bluetooth needs to be turned on. So I click the option to turn it on, and nothing happens. When I go back to the settings for bluetooth in the prefs menu, it confirms that bluetooth is off, and the button next to the status text to turn it on is greyed out and can't be clicked.
    The only way I can get bluetooth to come back on is to start the computer. I'm really just guessing about the screen saver activating it. Usually the screen saver comes on because I've gotten up for a while. When I think about it, if I'm still sitting by the computer when it goes to screen saver, and I start using it again quickly, the mouse and keyboard work fine.
    I'm really fed up with it, it seems a lot of people are having similar issues. I use this computer as a living room internet browser, so I really need the flexibility of the wireless so it can be used from the couch (its on an end table and not a desk). If anybody has any good suggestions, please let me know. I'm confident that the issue is not with the keyboard or mouse, because when they stop working, system prefs always shows me that bluetooth is off. Why does it keep turning off! Why? Why won't it let me turn it back on again, why?

    http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/
    http://www.apple.com/batteries/iphone.html

  • The share button disappeared from my Facebook add-on just before I upgraded to Firefox 5.0. I thought by upgrading and reinstalling the add-on it might come back, but it didn't. All other FB buttons are there, near as I can tell. Any ideas? I'm using XP3.

    The share button disappeared from my Facebook add-on just before I upgraded to Firefox 5.0. I thought that maybe by upgrading and reinstalling the add-on it might come back, but it didn't. All the other FB buttons are there, near as I can tell. Any ideas? I'm still using XP3.

    Hello,
    I had the same problem with finding this file.
    There's no such file in Mac OS X version of Skype. But there's a directory for your Skype user account in /Users/%current_user_name%/Library/Application Support/Skype/
    try:
    quitting Skype
    renaming old folder
    signing into the Skype

  • In subcontracting process same material to come back from vendor how?

    hi
    in subcontracting process i want to send x material for processing purpose and same material is going to come back tell me the process how can i do
    chandra

    hii
    For  ur scenario, u have carried out external service management process.
    Because , subcontracting is nothing but , u have to X material and receivea as A materia or some different material.
    SO if u r going to receive the same material , u can do it as service process.
    Thanks
    SAP-MM

Maybe you are looking for