Does new Thread(this) work for a Frame class?

package MThreads;
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
public class ThreadFrame extends Frame implements Runnable
{   Button btnNew = new Button("New");
Thread aThread = null;
public ThreadFrame()
{ /* nothing in here */}
public void run()
{ /** does stuff */ }
btnNew.addMouseListener(new MouseAdapter()
{  public void mouseClicked(MouseEvent e)
     {  aThread = new Thread(this);
     aThread.start();
The line aThread = new Thread(this); does not compile.
error is "can't convert MThreads.ThreadFrame.1 to java.lang.String"
Anyone got a clue??
Thanks
Nancy

You've just created an anonymous inner class new MouseAdapter. "this" now points to an instance of MouseAdapter and not Frame as you think.
package MThreads;
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
public class ThreadFrame extends Frame
     implements Runnable {
     Button btnNew = new Button("New");
     Thread aThread = null;
     final Runnable frame;
     public ThreadFrame() {
          frame = this;
     public void run() {
          btnNew.addMouseListener(new MouseAdapter() {
               public void mouseClicked(MouseEvent e) {
                    aThread = new Thread(frame);                     
                    aThread.start();
}Hope this helps you.
Hjembaek

Similar Messages

  • HT201240 This process does not appear to work for me.  I'm running 10.8.3.  I created a new user for a guest staying with me.  They have gone now and I am attempting to either change the password or delete the user.  It won't allow me to choose the user I

    This process does not appear to work for me.  I'm running 10.8.3.  I created a new user for a guest staying with me.  They have gone now and I am attempting to either change the password or delete the user.  It won't allow me to choose the user I created.  I am logged in as myself and it states that I am an "Admin".  The user I'm attempting to change is listed as a "standard" user and there is a white checkmark inside an orange circular background on the user pic in the list of users. 
    Can someone help me?  I am having a hard time believing that OSx will allow me to create users and allow them use of my computer and it's drives, yet it will not allow me to change the password so I can monitor what they might have been doing while logged on?  What if this were my child?  This guest left under sketchy circumstances, and I'd really like to be able to ensure they were not using my computer to do illegal things or to have illegal communications.
    Any help would be appreciated.  (It's odd that it was so simple to "create" a user and set a password for them.......but it's complicated or a little known process to reverse.
    Thanks.

    Here are two screen shots to show you what I am seeing.  The first screen shot shows it allowing me to select (highlighted in blue) my admin user (which is what I am locced in as).  The second screen shot shows it allowing me to select the "Guest" user (highlighted in blue).  However when I click on the user "Orion" nothing happens.  It will not change to highlight that user.

  • HT2534 what country does this work for? no such caption as none on the paying option

    what country does this work for? no such caption as none on the paying option

    As far as I am aware it works for all countries. You are following the instructions on that page exactly e.g. it's a new account that you are trying to create and you are selecting a free app in the store and clicking on 'create Apple id' when 'buying' it ?

  • There were some updates on my Apps.  I updated them on my iTunes but my iPad did not get the same downloads/updates thru iCloud.  Does the iCloud only works for "New" Apps or Books downloaded from the store but not the "Updates"?

    There were some updates on my Apps.  I updated them on my iTunes but my iPad did not get the same downloads/updates thru iCloud.  Does the iCloud only works for "New" Apps or Books downloaded from the store but not the "Updates"?

    Purchased music does not count against your iCloud storage and you cannot get rid of them in the purchased tab.
    What is backed up
    You get unlimited free storage for:
    Purchased music, movies, TV shows, apps, and books
    Notes: Backup of purchased music is not available in all countries. Backups of purchased movies and TV shows are U.S. only. Previous purchases may not be restored if they are no longer in the iTunes Store, App Store, or iBookstore.
    Some previously purchased movies may not be available in iTunes in the Cloud. These movies will indicate that they are not available in iTunes in the Cloud on their product details page in the iTunes Store. Previous purchases may be unavailable if they have been refunded or are no longer available in the iTunes Store, App Store, or iBookstore.
    Look here for help on managing iCloud storage.
    http://support.apple.com/kb/HT4847

  • Possible LR CC Instability Fix - This worked for me...

    For those who have upgraded to LR CC and are finding the software to be unstable, are getting gray boxes instead of pictures when filtering images or are finding LR CC is slowing down your computer to a crawl this worked for me....
    1) Go to Pictures/Lightroom/  (or where you have designated your catalog files are stored)
              Rename LR 5 .Irdata file and catalog as .old or any earlier version of LR-if there
              Delete any catalogs and temporary files created by LR CC - yes if you have any work in those files it will be lost, this is the unfortunate trade off to have a working copy of LR CC
    2) Run LR CC as administrator (I haven't tried running it normally, it may work), when if first starts a dialogue box will pop up stating the default catalog cannot be found and ask if you want to create a new one or try to find an existing one - create a new blank default catalog
    That's it.  (Of course I found this after spending 90 minutes waiting for chat help and 2 hours with chat, and uninstalling both LR CC and PS CC2014 in hopes of fixing the issues I was having.)  I've been able to reprocess the images I was working on when I upgraded and converted the catalog...I don't know if this is an upgrade issue or if I did something wrong in the upgrade, but I had a frustrating 3 days of being unable to process a client's family pics and computer crashes.
    Briefly, LR CC would start and open, no hangs or crashes on the splash screen, it would kind of work for a few minutes then the pictures would turn into gray boxes, then the software would just stop working, no error, nothing just unresponsive.  My laptop would slow to a crawl and I would be forced to restart and my laptop would have to be hard booted to be shut down.  If I left LR CC open and my screensaver would start and my laptop would sleep on "waking up" I would have nothing on the screen - no task bar or desktop icons - just a picture and a mouse that moved but did nothing else.
    I hope this helps.
    I wish you luck and virtual chocolate,
    Nonnie

    Thanks for this! I tried doing it a different way and completely ruined my sound all together to the point that there weren't even any audio outputs detected! Fortunately this fix got me back on track and it's working again.

  • Running an old MacBook Pro 2.5ghz core 2 Duo. Battery went chemical meltdown and expanded out of its housing. Removed it and was running off the power cord. This worked for a while. Now it won't start up. Have a Replacement on order. Is there a bigge

    Running an old MacBook Pro 2.5ghz core 2 Duo. Battery went chemical meltdown and expanded out of its housing. Removed it and was running off the power cord. This worked for a while. Now it won't start up. Have a Replacement on order. Is there a bigger issue or does a battery need to be in the compartment to boot up? Appreciate any help. Thanks.

    Working battery needs to be in for the computer to function.

  • How does true/false evaluation works for Objects?

    Problem: I need a mutable Boolean but I want it to be easily used in expressions like if(muBoolean){...}
    I could not find any hints when looking at java.lang.Boolean sources.
    Thanks
    fatzopilot

    java has no such magic. objects are not booleans, and vice versa. the only minor magic you may see is that Booleans are automagically unboxed to booleans. thus, "if(Boolean.TRUE)" works because the Boolean is converted to a boolean. Boolean is special, though, this does not work for any other class in java (it's handled by the compiler, which just converts that expression to "if(Boolean.TRUE.booleanValue())").

  • Can firefox support "file:///" format to access local files (note 3 fw slashes) this works for IE but not firefox and is the format used in the "afghan war diary" from wikileaks

    can firefox support "file:///" format to access local files (note 3 fw slashes) this works for IE but not firefox and is the format used in the "afghan war diary" from wikileaks

    See http://kb.mozillazine.org/Links_to_local_pages_do_not_work

  • My safari won't load. firefox does. have had this computer for 2 years now, first time i'm having issues. what do i do???

    my safari won't load. firefox does. have had this computer for 2 years now, first time i'm having issues. what do i do???

    Going by your profile v10.6.8.
    Reinstall Safari >  Safari 5.1.9 for Snow Leopard
    Then restart your Mac.

  • Mic doesn't work after upgrade to iOS 7.0.2 ? go to settings privacy microphones and allow access( green button) to apps This worked for me

    Mic doesn't work on iPad 2 after upgrade to ios7.0.2? Go to settings / privacy/ microphones. Then allow access to relevant apps (green button)
    This worked for me on skype, vocal live, mic pro apps

    Can't believe this worked! I had same issue since upgrade, searched web, found this... Hoover the mic for around 15 seconds... It only flaming well worked!  

  • Re: Mifi and Charging - does this work for charging the iPad?

    I found the following post on here - but it is too old for me to reply directly to it - however, this was a very good post and it worked for me and I would really like to get in touch with mikebob to see if the same thing would work for charging the iPad - his ideas really work. And does he or anyone know how to charge the iPad from batteries?
    thanks a lot
    mikebob
    Contributor
    http://community.vzw.com/t5/user/viewprofilepage/user-id/28840
    Posts: 3
    Registered: 08-25-2009
    Device: mifi 2200
    0
    Re: MiFi and Charging 
    Options
    10-01-2009 07:38 PM
    I finally managed to figure out the proper cabling to get the Verizon Mifi 2200 to charge using a generic USB charger. To recap the problem... The mifi device will only charge when using the supplied micro usb charger, or when connected to a computer USB port using the supplied micro USB cable. When connected to a computer, the device reverts to it's connected data mode, which turns off the wifi ssid broadcast and requires the Verizon access manager application to be launched. Most third party chargers will not work... including most 12V lighter to USB adapters, and most backup battery solutions.
    Here is what is going on... Per the USB specification, Pins 1 and 4 are 5V power and ground respectively. Pins 2 and 3 are data+ and data-. In most chargers, pins two and three are tied via a pullup resistor to the 5V line. If you measure the voltage on 2 and 3 you will see around 3V, equivalent to a logic high state. This has something to do with allowing the device being charged to identify whether it should be in a fast or slow charging mode. More importantly, it is what the Apple iPod expects to see . So, anyone wanting to build generic USB chargers will probably implement this way in order to tap into the single largest device market around. Unfortunately, the mifi does not like the logic high on pins 2 and 3. I haven't yet sorted out why, but when it sees logic high on pins two and three, it refuses to go into charging mode.
    The solution is to use a cable where pins 1 and 4 (5V and GND) are carried straight through. Pins 2 and 3 need to be disconnected from the charging source and shorted together at the Mifi end. If this was a miniUSB instead of a microUSB, it would be what is called a "charge only" cable. I have not found any vendors yet for a charge only microUSB cable so I went ahead and performed surgery on a standard microUSB cable. I took a standard USB cable, cut it and then connected it to a microUSB connector from an old Motorola bluetooth headset charger.   Interestingly, the microUSB connector from the Moto charger  already has pins 2 and 3 shorted together internally so all I had to do was connect 5V and ground and heat shrink tube the whole thing. With this cable I can charge the mifi from any generic USB port, including those on 12V lighter adapters, and rechargeable backup batteries. In addition, I can also connect the Mifi to my laptop to charge while continuing to access the Mifi via wifi. 
    Only word of caution...  You really need to connect the Mifi to your computer using the standard data cable on occasion, say once per month.  The reason is that it is only in this mode that you will receive notifications of S/W updates and/or the need to update your PRL. (preferred roaming list).

    Connect to iTunes on the computer you usually Sync with and “ Check for Updates “...
    If an Update Appears Install it... if not... you are up to date for your particular Device...
    Also see the very end of this Linked page...
    Apple - iOS 6 Whats New

  • Command-period to cancel EXS sample loading: Does this work for anyone?

    Hello everyone,
    When loading a sample instrument into the EXS, watching with glee as that wonderful progress bar slowly fills up; underneath there is this note: Press "command-period" to cancel. No matter what I do nor how hard I try, I cannot get this key command to work. When I first noticed this problem long ago, I searched both manuals and found nothing, and with a great sadness in my heart, I defined it as a "no longer supported feature" in logic and moved on.
    Today, after experiencing the relentless loading of unnecessary samples (see my other post) my thoughts wandered yet again to how wonderful life would be if this feature actually worked!
    So I'm asking, has ANYONE been able to get this to work? If not, anyone know of a work around to cancel the loading of samples?
    I anxiously await your replies, and thank you for your help.

    Jonathan,
    It's never worked for me either. Sorry I don't have a work around (other than unplugging the computer), but did want to confirm that indeed it doesn't work.
    It does work for the bounce progress bar though.... Not that that helps, but is worth mentioning.

  • Does this work for anyone else?

    I've elected in Edit->Preferences to "Confirm when closing multiple pages" under tabs, but it does nothing of the kind. Opening multiple tabs then closing the window does not ask for confirmation. Any one else get this working?

    Ditto. It will close a window with multiple tabs with no announcements of doom even with that checked. That's true whether or not it's the only Safari window open on the system.
    MacBook Pro 17"   Windows XP   (in Parallels)

  • Why does installation cd not work for new hard drive for 2009 MacBook pro?

    my hard drive died in my 2009 MacBook pro so I bought a 1tb ssd drive and had the store physically install the drive only.   I arrived home and stuck in the original installation disc and pressed and held the c key after the chime. Nothing happened. after a minute or so the screen turned black and rebooted up again with the chime.  It would continue to reboot whether I pressed the c key or not. when i pressed the d key it would say:
    "Apple hardware test does not support this machine"
    why why isn't this working like it is supposed to?
    thsnks

    Ryan,
    Have you tried using the Startup Manager (holding down the option key) whilst booting? If everything works as it should, you should be given the option to choose the DVD to boot. Holding down the 'D' key should load the Apple Hardware Test.
    Good luck,
    Clinton
    MacBook Pro (15” Late 2011), OS X 10.??, 16GB Crucial RAM, 960GB M500 Crucial SSD, 27” Apple Thunderbolt Display

  • I want the cursor to be in the address bar when creating a new window; it works for new tabs and in a new private window, but not in safe mode.

    I have tried following the advice offered in the few different threads I have found on this but nothing fixes it. I want the cursor to be in the address bar when I open a new window and/or when firefox opens without restoring a previous session. I fixed the issue for new tabs via about:config but this doesn't work for new windows. I tried safe mode and the problem persists. In new private windows the cursor is in the address bar.

    The search box in about:home steals the cursor. Changing your home page to something else will cause the cursor to start in the address bar for new windows.

Maybe you are looking for

  • Please fix: Common Open File Dialog Box to support Favorites (Follow-up: Better provisioning in the Windows client)

    One more thing: What's missing is favorites is a way to use the favorites space in the Common Open File Dialog Box. Please obsolete or (re)develop components in Windows, so those components support any new workflows in Windows! On example of an appli

  • How to restore Vista on old Satellite P300?

    Sorry this is a long one. I bought a new P70 to replace my older P300 which came with Vista and now want to restore it to a clean install for the children to use. The problem is that I had partitioned the drive and had been testing the betta and RC1

  • Acrobat 9 crashes after startup window

    when I start Acrobat 9, it crashes right after the main window opens with a " Adobe Acrobat 9.0 has encountered a problem and needs to close. We are sorry for the inconvenience." erroe. I had it working on this machine but must have done something to

  • How to set a Break point in Comp Workbench

    Hello Guys, I have a Z** Enhancement set ( t-code: bsp_wd_cmpwb)  and i have a view & a Z**IMPLclass for it. I need a way to set a break point in the Z*IMPLclass in t-code: bsp_wd_cmpwb. I have my code in this Z* impl class and making some changes fo

  • Schema Objects.

    In schema , some of the objects(Packages.Tables) modified/createdby one of the user. I want to know the log history of those Objects.(when , who modified of the which object) Thanks, Anzy