How do you start a loop with an event and end the loop when u release ....

How do you start a loop with lets say an event of some sort, whether it be holding down a key or pressing the mouse click and then stopping the loop when you release that key or mouse button.?
double c = 1.8, i = 1, max = 90, exp = 0;
final double inc = 0.002; //speed at while it increases
boolean f = false, g = false;
while (true)
    while (f == false && stopMeter == false) //increasing speed going up to 90
        exp = Math.pow (c, i);
        i += inc;
        pAngle.setText (Math.round (exp) + "");
        if (exp > max)
            f = true;
            g = false;
        } //end if
    } //end while
    while (g == false && stopMeter == false)  //decreasing speed going down from 90
        exp = Math.pow (c, i);
        i -= inc;
        pAngle.setText (Math.round (exp) + "");
        if (exp < 1)
            g = true;
            f = false;
        } //end if
    } //end while
} //end whilethis is a snippet of my increasing increments. Its for an angle meter. I can't get it to stop, when the user clicks or does something... the program just gets stuck in an infinite loop. I am still new to java and i do not know how to fix this.

You are in the wrong forum. Try this one instead: http://forum.java.sun.com/forum.jspa?forumID=31
/M

Similar Messages

  • How do you do home share with in different accounts on the same computer?

    How do you homeshare within different log in accounts (and itunes accounts) within one computer?

    Simply connect them.  One computer with one iTunes can manage multiple devices.  They're tracked by S/N but you might wish to assign them unique names so that you can track them yourself.
    The only minor issue is app updating and purchases while on the computer.  It's necessary to log out and back in to the "correct" ID.  Much easier to do these things from the iPods.

  • How do you start a document in Word (PC), and send to iCloud ?

    I have to use a PC at the office, Mac Mini or iPad2, and iPhone 4, and want to sync docs from all.  Sounds like I have to buy iPad/iPhone Pages app, then Pages program for Mac Mini.  What about when I start the document on the PC at work?

    Where have you saved the document, or are you talking about a template?
    You do not delete any documents inside Pages. You must locate them in Finder (probably in the Documents folder) and then drag them to the Trash.
    If you need basic help with using a Mac, Apple has helpful videos and tips in their Support section of their website.
    Peter

  • How do you turn on mobile with ipad...message I get when trying to update oto IOS

    How to you turn on mobile on Ipad or itunes so that you can update to

    Is this what you mean?
    There have been some problems accessing pages on the Apple web site.  If the hyperlink gives you a "We're sorry" message, try again.

  • How can you take a photo from one event and put it in another, without dragging to desktop and dragging back into iPhoto and moving it to the event folder I want it in.

    As the title says I need help on how to take a photo from one event and put it in another, without dragging to desktop and dragging back into iPhoto and moving it to the event folder I want it in. Right now when I want to move a picture from one event to another I drag it to my desktop then delete it from iPhoto then I drag it back into iPhoto and put where I want it.An example would be taking a photo from the Christmas event and add it to a specific person event.  Can I do that within the events section without all the dragging. Also is there anyway I can remove duplicates from iPhoto without going through each and every file. Any help would be greatly appreciated.

    Apple doesn't make it easy to do what you want.  However, here's how I do it. 
    Select the photo you want to move and create a new Event for it via the Event ➙ Create Event menu option.
    In the Event mode select the new Event with the one picture and drag it onto the Event you want to move the photo to.

  • How do you get your text messages to not show on the screen when they come in

    How do you get your text messages to show on the screen when then come in?  My iphone 3s would just say the persons name and text message.  This says the persons name and the whole message

    Settings > Notifications > Messages > Show Preview - Turn to OFF

  • How do you make it print first page first and not the last page first?

    I have a HP Officejet Pro 8600. How do I make the first page print first and not the last page printing first?

    Hi,
    From the application used to print open the print dialog and click Oroperties or Preferences to access the Printing Preferences screen.
    From the Layout tab set Page Order as Back to Front, then the first page will be printed first.
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • How do you share library's with different accounts and different users

    My family has lots of music and to save hours of time we want to share our music, is this possible? The only problem is, we each have different Apple ID's and our own computers.

    Each device will ONLY sync what you select.
    Just do not select the apps that you do not want.  Only select the apps that you do want.

  • How would you select part of a letter/font and change the colour of it ??

    for example i want to selct the the letter 'b' and just want to change the colour of the ascender' ( the top half of the b) how could i do this on INDESIGN
    like this

    Here are a few tips to get started:
    (1) When you create outlines, hold down the Option/Alt key when you choose Type > Create Outlines. That will make a copy of the outlines which isn't anchored in the text frame. Move that copy away from the original frame.
    (2) Select all the word with the Direct Selection tool and choose Object > Path > Release Compound Path. That will separate the letters from each other so you can work with them (it also fills in the counters (centers) of the letters).
    (3) To create the effect on the "T," I selected the letter with the Direct Selection tool (selecting all the anchor points) and chose File > Copy, then chose Edit > Paste in Place to make a copy on top.
    (4) I moved the top copy a little (Shift + Up Arrow) so I could select the bottom copy, then I locked the bottom copy (Object > Lock). I moved the top copy back (Shift + Down Arrow).
    (5) With the Direct Selection tool, I selected the lower anchor points and deleted them. I filled the top anchor points with blue. Here is how far I got:

  • How do you delete part of a PDF file and keep the rest

    If I want to keep page 2 but not pages 1 or 3...how do I do that?

    Possible with Adobe Acrobat, not Adobe Reader.

  • How do you associate a view with a form?

    How do you associate a view with a form and make it accessible in the form?

    Try this
      <Field name='myview'>
                        <Display class='Text'>    
                            <Property name='title' value='My View'/>
                        </Display>
                        <Derivation>                       
                            <invoke name='getView'>
                                <ref>:display.session</ref>
                                <concat>
                                    <s>User:</s>
                                    <ref>accountId</ref>
                                </concat>                       
                                <map>
                                    <s>authorized</s>
                                    <s>true</s>
                                </map>
                            </invoke>
                        </Derivation>
                    </Field>           
                    <Field name='myview.waveset.organization'>
                        <Display class='Text'>    
                            <Property name='title' value='User Org'/>
                        </Display> 
                    </Field>

  • How do you start the hardware test on an imac with bluetooth keyboard

    How do you start the apple hardware test on an imac with a bluetooth keyboard as the instructions is to press the D key whilst restarting? And of course the imac cant see the keyboard whilst booting up as the bluetooth connection has yet to be established

    Have you tried following the directions for running it from the DVD? The instructions are on the Hardware Test link.If you are correct and it cannot due to the wireless keyboard not making a connection you will need to borrow a wired USB keyboard.  

  • Working in Logic 9, how do I use a drum loop WITH ITS PRESET EFFECTS? I can drag and drop the loop but it plays dry in timeline. thanks

    Working in Logic 9, how do I use a drum loop WITH ITS PRESET EFFECTS? I can drag and drop the loop but it plays dry in timeline. thanks

    Here's the short-cut solution:
    Green Apple tracks are MIDI files (so to speak). If you drag one from the loop browser (Capitol C Orchestral hit, as you mentioned in this exable) directly into the arrange page it creates the MIDI file and the instrument to play it back on.
    HOWEVER.If you create and audio track first, THEN drag the green Apple loop onto that track, the loop will get "bounced" with the reverb in tact and you'll have the exact sound that you heard in the preview.
    Make sense?

  • How do you structure a .book with an EDD?

    Hi all,
    I am learning how to convert legacy, unstructured FM documents into structured FM documents and need some help. So, I created a conversion table from my unstructured documents, created the EDD, applied the EDD to the unstructured document to create a structured document and now need to tweak the EDD.
    My question is, what is the correct way to layout the EDD rules for a book using multiple document styles? For example: My book contains a title page, TOC, one or more chapters, a glossary of terms, and one or more appendixes (or is that a appendicies?.)
    I am thinking the element rule would look something like this:
    Element (Container): BOOK
    Valid as the highest-level element.
    General rule: TitlePage, TOC, Chapter+, Index, Appendix+
    Followed of course by other elements required for the structure. However, I did see an EDD that I am sure was outlined like this (though I can't recall where:)
    Element: TitlePage
    Valid as the highest-level element.
    General rule: Blah blah blah
    Element: TOC
    Valid as the highest-level element.
    General rule: Blah blah blah
    Element: Chapter
    Valid as the highest-level element.
    General rule: Blah blah blah
    Element: Index
    Valid as the highest-level element.
    General rule: Blah blah blah
    Element: Appendix
    Valid as the highest-level element.
    General rule: Blah blah blah
    If the second structure is correct, how do you define the Book element? On the Adobe forum, I was told one EDD should be created for all book elements, which makes sense to me.
    Okay people, fire away. Remember I am a neophyte in structured FM.
    Thanks,
    Adam

    Thanks Van, that does clear it up for me... a little. My confusion now is, if I set all the book sections as valid at the highest level, then how does the book get structured as the starting point for the sections contained within it? I have tried to find a sample EDD detailing exactly this, but to no avail - my search brought up courses where this is covered, but not the actual EDD structure.
    When I try to structure the book with the EDD, the book comes up red with its children elements looking just fine. Ahh! You have to love that learning curve.
    Regards,
    Date: Thu, 24 Sep 2009 06:43:41 -0600
    From: [email protected]
    To: [email protected]
    Subject: How do you structure a .book with an EDD?
    Adam,
    Following up on some of Russ's sage advice, you asked:
    If the second structure is correct, how
    do you define the Book element? On the Adobe forum, I was told one EDD
    should be created for all book elements, which makes sense to me.
    As Russ said, your BOOK element looks fine. Not sure how far you have gotten, but when you open a document file that is in the book, its root element will be Chapter, TitlePage, Appendix, etc. That is why you have to declare each of these as being valid at the highest level. When you click in the book file window and look at the structure view, you will see that the BOOK element is the root element, and its content will be TitlePage, TOC, Chapter, Chapter,...etc. The book and all of its component files have the same EDD. The definitions for the BOOK element, as well as the TitlePage, TOC, Chapter, etc elements are all contained in the same EDD. I hope this helps to answer your question.
    Van
    >

  • HT201236 how do you make a bullet with keyboard shortcuts?

    how do you make a bullet with keyboard shortcuts?

    According to this https://discussions.apple.com/thread/1381905?start=0&tstart=0 Option 8 will insert a bullet.

Maybe you are looking for