Applet not quite working correctly, need second opinion

I'm sure you guys are getting tired of seeing me post questions, but I have another one. The following code is a simple Card Bet game(High Low). The problem is the score is not accumulating correctly. Sometimes it add when with should subtract, and vice versa. I got tired of trying to figure out my problems with SecretPhrase so I figured I would try another part of my project, only to run into more problems.
Code:
   import javax.swing.*;
   import java.awt.*;
   import java.awt.event.*;
   import java.util.*;
    public class JCardBet extends JApplet implements ActionListener
      JLabel title = new JLabel("** Bet the Card **");
      JLabel compCard = new JLabel("");
      JLabel playerCard = new JLabel("");
      int compRand, playerRand;
      int total = 10;
      JLabel totalMoney = new JLabel("");
      JLabel gameOver = new JLabel("");
      JButton fiveHigh = new JButton("$5 Higher");
      JButton tenHigh = new JButton("$10 Higher");
      JButton fiveLow = new JButton("$5 Lower");
      JButton tenLow = new JButton("$10 Lower");
      JButton ok = new JButton("OK");
      Font font1 = new Font("Helvetica", Font.BOLD, 34);
      Font font2 = new Font("Helvetica", Font.BOLD, 20);
      String[] deck = {"2 of Spades", "2 of Hearts", "2 of Diamonds", "2 of Clubs",
                             "3 of Spades", "3 of Hearts", "3 of Diamonds", "3 of Clubs",
                        "4 of Spades", "4 of Hearts", "4 of Diamonds", "4 of Clubs",
                             "5 of Spades", "5 of Hearts", "5 of Diamonds", "5 of Clubs",
                           "6 of Spades", "6 of Hearts", "6 of Diamonds", "6 of Clubs",
                        "7 of Spades", "7 of Hearts", "7 of Diamonds", "7 of Clubs",
                             "8 of Spades", "8 of Hearts", "8 of Diamonds", "8 of Clubs",
                        "9 of Spades", "9 of Hearts", "9 of Diamonds", "9 of Clubs",
                        "10 of Spades", "10 of Hearts", "10 of Diamonds", "10 of Clubs",
                        "Jack of Spades","Jack of Hearts", "Jack of Diamonds", "Jack of Clubs",
                        "Queen of Spades", "Queen of Hearts", "Queen of Diamonds", "Queen of Clubs",
                        "King of Spades", "King of Hearts", "King of Diamonds", "King of Clubs",
                        "Ace of Spades", "Ace of Hearts", "Ace of Diamonds", "Ace of Clubs"};
       public void cardGenerator()
         Random generator = new Random();
         compRand = generator.nextInt(52);
         playerRand = generator.nextInt(52);
       public void cardSort()
         Arrays.sort(deck);
       public void init()
         Container con = getContentPane();
         setLayout(new FlowLayout());
         con.add(title);
         title.setFont(font1);
         cardGenerator();
         cardSort();
         con.add(compCard);
         compCard.setText("Computer: " + deck[compRand]);
         compCard.setFont(font2);
         con.add(fiveHigh);
         fiveHigh.addActionListener(this);
         con.add(tenHigh);
         tenHigh.addActionListener(this);
         con.add(fiveLow);
         fiveLow.addActionListener(this);
         con.add(tenLow);
         tenLow.addActionListener(this);
         con.add(playerCard);
         playerCard.setFont(font2);
         con.add(totalMoney);
         totalMoney.setText("Starting with $" + total);
         con.add(ok);
         ok.addActionListener(this);
         ok.setEnabled(false);
         con.add(gameOver);
       public void actionPerformed(ActionEvent e)
         Object source = e.getSource();
         if(source == fiveHigh)
            cardGenerator();
            playerCard.setText("Your card: " + deck[playerRand]);
            cardSort();
            ok.setEnabled(true);
            fiveHigh.setEnabled(false);
            tenHigh.setEnabled(false);
            fiveLow.setEnabled(false);
            tenLow.setEnabled(false);
            if(playerRand > compRand)
               total = total + 5;
               totalMoney.setText("Your new total is $" + total);
            else if(playerRand < compRand)
               total = total - 5;
               totalMoney.setText("Your new total is $" + total);
         else if(source == tenHigh)
            cardGenerator();
            playerCard.setText("Your card: " + deck[playerRand]);
            cardSort();
            ok.setEnabled(true);
            fiveHigh.setEnabled(false);
            tenHigh.setEnabled(false);
            fiveLow.setEnabled(false);
            tenLow.setEnabled(false);
            if(playerRand > compRand)
               total = total + 10;
               totalMoney.setText("Your new total is $" + total);
            else if(playerRand < compRand)
               total = total - 10;
               totalMoney.setText("Your new total is $" + total);
         else if(source == fiveLow)
            cardGenerator();
            playerCard.setText("Your card: " + deck[playerRand]);
            cardSort();
            ok.setEnabled(true);
            fiveHigh.setEnabled(false);
            tenHigh.setEnabled(false);
            fiveLow.setEnabled(false);
            tenLow.setEnabled(false);
            if(playerRand < compRand)
               total = total + 5;
               totalMoney.setText("Your new total is $" + total);
            else if(playerRand > compRand)
               total = total - 5;
               totalMoney.setText("Your new total is $" + total);
         else if(source == tenLow)
            cardGenerator();
            playerCard.setText("Your card: " + deck[playerRand]);
            cardSort();
            ok.setEnabled(true);
            fiveHigh.setEnabled(false);
            tenHigh.setEnabled(false);
            fiveLow.setEnabled(false);
            tenLow.setEnabled(false);
            if(playerRand < compRand)
               total = total + 10;
               totalMoney.setText("Your new total is $" + total);
            else if(playerRand > compRand)
               total = total - 10;
               totalMoney.setText("Your new total is $" + total);
         else if(source == ok)
            cardGenerator();
            compCard.setText("Next computer card :" + deck[compRand]);
            cardSort();
            ok.setEnabled(false);
            fiveHigh.setEnabled(true);
            tenHigh.setEnabled(true);
            fiveLow.setEnabled(true);
            tenLow.setEnabled(true);
         if(total <= 0 || total >= 100)
            gameOver.setText("Game Over!");
            gameOver.setFont(font1);
            ok.setEnabled(false);
            fiveHigh.setEnabled(false);
            tenHigh.setEnabled(false);
            fiveLow.setEnabled(false);
            tenLow.setEnabled(false);
   }

See thats just the thing, I don't think my sort() is working correctly, because if it was thensort() is a library method. Whatever it is documented to do, you can rest assured it is doing it correctly.
playerRand and compRand are ints. You assign to them in the cardGenerator() method with the lines
compRand = generator.nextInt(52);
playerRand = generator.nextInt(52);and there is no reason why they should not be equal.
I don't know if this is the source of the problem or not - basically I don't know what "the score is not accumulating correctly" means.
Since you have random numbers being generated it can be difficult both to reproduce and describe problems. One way to lessen this difficulty would be to make generator an instance variable and initialise it in the constructor. One of the Random constructors lets you provide a seed value. The effect of this that the numbers generated are still "random", but are also completely reproducible. This is a good thing for testing.
Also you could split the huge actionPerformed() method - perhaps having a number of action listeners each with a more moderate sized actionPerformed() method whose intent can be documented and whose implemention can be tested.
Edited by: pbrockway2 on Jul 20, 2008 2:13 PM
Why do you sort the array of strings anyway? And why, having sorted it, do you periodically sort it again (since at that point it is already sorted)?

Similar Messages

  • Web form not quite working correctly

    I have created a simple web site with iweb and have entered a simple web form on my contact me page. I created the "form" in dreamweaver (an extremely simple form) and copied the html code into iWeb via the html snippet and online instructions. When viewing the page when posted, it appears fine, but whenever a user inputs data into the form and clicks submit, it navigates to a page of just my form HTML code, ie. a white page with just my form fields on it. Also, I downloaded some simple free code for a "date picker" for a date field on my form, and whenever this button is clicked, it opens that same window described before. Any suggestions on what can be wrong?
    Extra detail:
    I am hosting the site myself through apache.
    The forms action attribute is set to results.php
    The location of results.php is correct
    results.php is suppose to send an email to myself notifying me of the data just inputted.
    results.php was created outside of iWeb (since iWeb does not create PHP pages)

    Thanks for your suggestions. I got it working somewhat, but now having a slightly different problem. I have the form displayed correctly and when filled out and submit is clicked, the results.php is opened correctly (just a simple page stating "Thank you, we will contact you soon", etc.) I dont remember exactly how I got it working, but I remember it was something with the location of the results.php file itself (althought I still cant get the date picker javascript + swv working correctly, but I'm just going to remove that).
    My new problem is that in the results.php file I am using the mail() function to send the data in the form to my email address. Like I stated before, the results.php file displays correctly after hitting submit, with no php errors, but it just wont send me that mail. This problem is not related to iWeb and maybe I should just post it in another section, but does anybody know what could be wrong, or is there some type of setting that needs to be turned on for it to work? Thanks!

  • Updated to Oct 2014 version of photoshop CC. since that time cannot save ANY work.  I can work on files but when I hit 'save as" every time it says "photoshop has quit working and needs to close."

    Updated to Oct 2014 version of photoshop CC. since that time cannot save ANY work.  I can work on files but when I hit 'save as" every time it says "photoshop has quit working and needs to close." Need solution now.

    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • After Photoshop Elements quit working for the second time in three months, I uninstalled it and now cannot get it to reinstall from the disc. Nothing happens when I insert the disc. All I can do is look at the folders and files and see nothing that tells

    After Photoshop Elements quit working for the second time in three months, I uninstalled it and now cannot get it to reinstall from the disc. Nothing happens when I insert the disc. All I can do is look at the folders and files and see nothing that tells me how to start the installation. Clicking "open with Auto play" gives me irrelevant options, view photos, share, etc. I'm running Windows 8. This program has worked, although buggy, for the past year.

    reinstall by clicking setup on your disk or downloading and installing,
    Downloads available:
    Suites and Programs:  CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • Subclips inconsistent behavior; not always working correctly in Premiere Pro CC

    I load a clip into the Source panel.  I set in and out points and then CTRL + U to create a subclip.  I have "Restrict Trim to subclip boundaries" turned off.  (Thank you Adobe, I've been waiting for "soft" subclips forEVER!)  The new subclip appears in my Project panel with the correct name and duration (as well as a white audio icon to indicate that it has not yet been used in my project).  Now, I drag that subclip into my sequence.  But the entire clip (a 5 minute interview), from which the subclip was derived, is loaded onto the timeline.
    This has been working correctly for the last hour, and now it has stopped working.  It appears that for the moment, subclipping is dead to me. 
    Help?!

    Thanks for that, Mark.
    I've done a little more testing, and the problem seems to be related to merged clips where (for me) the audio is longer than the video.
    Here's a screenshot of some testing I did:
    Let me talk you through the project browser:
    - At the top there are the source video and audio
    - I then made bins for a trimmed sequence version and an untrimmed sequence (what I mean by trimmed is that the audio was chopped down to the same duration as the video, after syncing)
    - I did the syncing on both manually. For the untrimmed clip, the audio leads the video by 1:29:04.
    - I then made merges of both
    - I then made subclips of both
    Remarks:
    1) The trimmed versions seem to work fine, though I haven't done serious testing. At least the media start and end make sense.
    2) The untrimmed merge "Merge (untrimmed)" is showing a Media Start of 23:57:04:10, which is just wrong. First of all this is a 'negative' time number (C++ signed/unsigned int math coding error?), secondly, it doesn't seem to match anything because it is an offset of -2:55:14, when the video offset is +1:29:04.
    3) When I open "Untrimmed.Subclip001" (as shown in the Source window) it shows a start time of "23:57:04:10" (the very beginning of the "Merge (untrimmed)" clip) instead of "23:58:33:14" which is where I'd set the in point for the subclip (and is shown in the Media Start column). What plays back is, indeed, the very beginning of the untrimmed clip. This is also the case with "Untrimmed.Subclip002" which had an In point set at 6:00:00.
    4) The Subclip Start times shown are totally broken. I really have no idea where it is getting those numbers from. On the other hand, the End times seem to be ok (if you again ignore the fact that I have an end time of "23+ hours" on a clip that is 1 hour long.
    5) The Audio In and Out Points shown don't make any sense to me. They're all just a little bit off the other numbers that are shown.
    Lastly, the source video is AVCHD 1080p24 from a Panasonic GH2 and the audio is 48kHz 24-bit mono from a Zoom H4n
    I hope this helps with your diagnosis.
    Looking forward to your feedback.

  • Frequent updates causing other programs not to work correctly

    I have a fitness computer called Body Bugg. After one of the frequent updates by Firefox, portions of the program stopped working.
    I tried downloading the newest update for Java but the program continues to give me a black screen and displays "done" rather than the normal form that should be displayed.
    I have to completely back out of the internet and go back in for the program to work correctly.
    It doesn't happen in IE. I prefer not to use IE, can you assist with this?
    Thanks,
    Eve E Greditzer

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Applets not sharing VM correctly in Java 7u4+

    Hi,
    We have an application that uses multiple applets that need to be able to communicate with each other (ie. share a single java.exe). In 6u32 our application works as expected, however since installing Java 7, even when specifying a java_version = 1.6* we have found that our applets are intermittently no longer able to share a single VM. In these cases I see multiple java.exe in my task manager and our application cannot function correctly.
    Has anybody seen this behaviour at all, or have any suggestions about how we can address it to ensure that our applets share a VM reliably?
    Thanks!

    Thanks for the replies. I'm not sure whether it will be possible to rewrite our inter-applet communication, indeed the below link indicates that what we are doing should work (and has done to date, but seemingly not under Java 7), but we'll investigate whether the applet context streams are what we need to be using.
    http://www.java-tips.org/java-se-tips/java.applet/have-applets-on-different-frames-communicates-with-each.html
    Cheers!

  • ITunes 11 home sharing with iPhone not quite working

    This morning I updated iTunes 11 to the newly released iTunes 11.1. I never could get home sharing to work with my iPhone 3GS (iOS 6.0.1). It would start to download the library information and then just stop. I used home sharing all the time so I was eagerly waiting for the fix many people seemed to need.
    So...Now getting the library information seems to take a long time--5 minutes or so, but it does run to completion. But, my lists of Artists and Albums are incomplete. I haven't done a lot of testing but it seems that all of my tracks are listed under Songs, and all of the references in my Playlists open the correct tracks. For example, Charlie Musselwhite is not listed under Artists. His album One Night in America is not listed under Albums, but the song Blues Overtook Me is listed under songs and appears in the Playlists where it belongs and clicking it there plays the correct song with the correct album artwork. Once I'm playing the song, I can switch from the artwork to the album list and all the album's songs are there and are playable.
    I haven't tested every song, but I've done enough to believe that all my tracks are accessible, even though only about 10% of the albums and artists are listed properly.
    BTW: I believe that the Album and Artist lists are the ones I would get if I changed iTunes to share only selected playlists, but I haven't bothered to prove this.
    What was a prohibitive problem has been made into a minor annoyance, but in case anyone form Apple reads this, let me say this. I have been an Apple user and fan from long before Apple made the first iPod or iMac, but I am incrasingly disappointed with the dumb things Apple now releases. In the past I never thought twice about updating the the latest version of anything, because whatever Apple released worked, and if there were a few minor bugs, new software never, never, never went backwards.
    Booooo, Apple.
    From now on I will be letting others do your beta testing for you while I continue to use maps that get me where I want to go and applications that work as advertised without drawing me into spending hours getting back to where I was before an upgrade. The fact that it is no longer possible to revert to a previous, properly working version of iTunes has cemented my feeling that I will remain safely behind the leading edge.

    just found it out after playing around to get itunes 11 to look like the older version go to view ( TOP LEFT )
    and click on show sidebar and then click ON SHOW STATUS BAR ... Then go to file and sign out of home share and then sign in again ... thats it and your import and sttings and other boxs will reapear ...REMEMBER TO REPEAT THIS ON ALL COMPUTERS THAT ARE RUNNING ITUNES .........HOPE YA WIFE IS HAPPY ..MINE WAS ....

  • Liquid layouts not quite working... help!

    Hi Guys,
    I am hoping one of you will be able to help.
    I have finished reading some books on AS3 and started working
    on a liquid transition animation using actionscript 3.0 (see
    attached .fla). Basically, I am setting the stage scaling to
    NO_SCALE and playing with a 4:3 aspect photograph as a background.
    I have setup an event listener to detect stage resizing so that the
    background image is tweened to the correct aspect ratio. There are
    two dynamic text fields keeping track of the stage dimensions for
    debugging purposes.
    The if statements in the listener function basically detects
    if the width of the stage is larger than the height. Based on that
    calculation the dimensions of the background image are in turn
    recalculated. So if the stage width is larger than the stage
    height, then the image will be tweened to have its height .75 of
    the stage width amount; in the case of a stage height being larger
    than the stage width, then the bg image width will be 1.33 times
    the stage height.
    Technically, the code works, but when you start playing
    around with resizing, the stage dimensions registered on the text
    fields don't really match what you see on the screen and I am
    unsure if it's a bug or if the stage is trully that size. Sometimes
    when I resize the screen I am positive the height of the stage is
    larger than the width but the text fields state otherwise and the
    code is behaving based on what the text fields register, which is
    what is supposed to be doing, but the image doesn't crop correctly.
    I need one of you actionscript gurus to look at the code and
    tell me what you think mught be happening. I really appreciate
    it.

    first breez1 – in AS2 you are correct, that is how to
    get properties of the Stage object. In AS3, it has changed.
    Next for RGracia, here is a neat trick that will make your
    code a bit easier to read and follow – at least it made
    things easier for me. It is called the ternary operator and it
    allows you to do a conditional and then assignments all in one
    step. So you can do something like:
    bg.width = (sw > sh) ? sw : sh * 1.33
    That basically reads as, if sw is larger than sh assign the
    value sw to bg.width otherwise assign sh times 1.33 to bg.width.
    Basically if the part in parens is true then the value before the
    colon is assigned and if the part in parens is not true then the
    part after parens. Neat, huh?
    Over all the basic set up here seems more or less correct.
    I'm wondering if the problem comes from the tweens? I don't see
    anyplace where you are stopping and deleting the old tweens.
    Remember the RESIZE event happens a bunch of times when you resize
    the window. Not just at the end of the movement – at least I
    think that is what happens. So you might be assigning crazy
    multiple tweens? Just a thought, you might just want to try it
    without the tweens first to get it jumping to size, then try and
    make the tweening work.
    I don't think screen resolution is playing any part in the
    the way the player detects the stage size. The stage size is the
    size it is. I do remember when I was doing something like this
    using AS2 and there was a bug with the way Firefox (or was it
    Safari) sent the resizing events when I would change just the
    height of the browser window. If I was just adjusting the height of
    the window, no event was fired. As soon as a I adjusted the width,
    BANG, they would both jump to the correct values. Perhaps that is
    what you are experiencing?
    Can you provide a link to the page?

  • MST/RSTP not quite working

    Hi,
    I have 6 x 3560 switches all connected in a redundant ring topology and interconnected using fibre.
    I have enabled the fibre ports as trunk ports with dot1q encapsulation.
    I have created 6 VLANS and defined ports on each device as members of the configured VLANS, and also defined a VTP root switch (all VLAN info appears to be propagating correctly between all switches).
    I have enabled MST on all the devices and created an instance 1 with a name and revision number on all of the switches which are identical.
    I have also used the root and secondary mst commands to define a root and secondary switch.
    E.G:-
    spanning-tree mode mst
    spanning-tree extend system-id
    spanning-tree mst configuration
    name ABC
    revision 1
    instance 1 vlan 1-200
    The problem I am seeing is that if I remove the fibre from the ROOT port from the ROOT switch, the comms fail and I see a time out of approx 8-10 seconds before the link is re-established using the redundant path (second fibre port. I see the port swap the MST01 from DESG to ROOT, when the previous ROOT port goes down (cable removed).
    Ive reduced the forward time to the minimum 4 seconds, which has improved the recovery time, but still not <1 second which I need.
    Im confused as to why when I setup a device on 1 switch to ping a device on the adjacent switch (ie next device in the fibre), but is on the same VLAN, that the layer 2 comms should be affected by the removal of the Root switch link (physicaly not even connected to the 2 devices which need to talk).
    I can see if the root switch is totally removed from circuit, that the secondary takes over fine.
    Im also not doing any layer 3, inter-vlan routing.
    Can anyone help?

    If tuning the forward delay timer had any effect, it means that your network is not taking advantage of the MST protocol. Reconvergence is achieved with no use of the forward delay timer in your scenario. Check that all the links in your ring are seen as point-to-point by the STP. You can also adjust the max-hop parameter to a value closer to the size of your ring (assuming that your MST network is only this ring, you could tune it down to 8 for instance). Also, you may want to upgrade your software release if it's an old one, as the response to agreement have been optimized (it may save some few seconds). At last, if you are only using one instance, the simplest and the most efficient is to keep the default configuration, where all the vlans are mapped to instance 0 (but I guess your network is more complex than what you exposed).
    MST uses a sync mechanism that explains that the communication between your edge switch could be affected by a failure on the root. That should be short though.
    Regards,
    Francois

  • My mail app is not quitting and i need to update a app in apple store which is not letting me do because the mail app is in use

    i try to quit it but it won't work just like the finder app that you can't close i need help

    Open up the Activity Window - if there are bars with stop signs by them - that don't seem to be moving press the stops signs to stop what is going on.
    If you can't open it or nothing is there - you may just have to power down.  
    I have had mail seem to be stuck so I can disconnect from the internet - so if I cant do a controlled shut down - I just power the system down by holding the power button down.   

  • Multicam not quite working right

    When using Multicam editing in FCP 6 sometimes the viewer reverts back to a single angle when the canvas is playing. It goes back to my original 4 angle view when stopped. This problem is sporadic, and I can't identify what makes this work or not.
    Has anyone else seen this behavior? Any fixes/ ideas??
    Thanks.

    Not a bug, just an FCP feature you have to get used to.
    When you have 'auto-render' activated, FCP will render whichever open sequences you've set the preference for.
    Since multiclip is essentially an 'effect', FCP sees it as something that needs to be rendered.
    Once you've collapsed the multiclip, it should not require rendering...unless of course you're working with media that doesn't match the sequence settings.
    Glad it worked for you. Thanks for the star.
    K

  • One thing fixed with iOS 4 and one thing not quite working yet.

    Well, I was just outside after updating my 3GS to iOS4 and I noticed that my GPS lock-on was FIXED. It now locks on in mere seconds and shows a VERY accurate fix. Whether I have the Wi-Fi turned on or not, it just works now. I had all sorts of issues with this in 3.1.x but now it just works.
    Now to the thing that is not working. My bookmarks from MobileMe are not being downloaded and applied to Safari in iOS4.
    If anyone else has had this issue and knows of a fix, I would be most appreciative.

    This issue is now resolved for me. I stopped the sync for all the different MobileMe services and then re-enabled them. Now, it all works as intended.

  • Worker thread not quite working

    I had the standard 'waiting for a database' gray box problem. So I put my db calls into a worker thread. It was impractical to use the WorkerThread class that Sun distributes, so I wrote my own (see below). This solved the problem in most but not all cases.
    In some situations, the user is looking at one window that overlaps another. When a button on the top window is pushed, the top window is dispose()'d of, and the worker thread is started. In this situation, the gray box problems rears its ugly head, despite the use of the worker thread.
    Could that dispose() be causing the problem? Do I need to repaint the remaing window before calling the worker? If so, what command should I use? repaint()? setVisible(true)?
    Any thoughts or suggestions would be appreciated.
    Barnet Wagman
    My worker thread code:
    public class BossClass {  // The worker thread is an inner class of this one
            // The following fields get used by the worker thread;
            // could this be a problem? I don't think so.
        private transient byte outcome;
        private transient Object resultObject;
        private transient URL url;
        private transient Thread mainThread;
        private transient boolean allDone;
            // Sends a command to a server and gets a returned object
        public synchronized void send(URL url) throws IOException {
            // ^ I've tried this with and without the synchronized - no difference
         this.url = url;
         mainThread = Thread.currentThread();
         allDone = false;
         new SendThread();
         while( !allDone ) {
             try { Thread.sleep(mnemonaface.Constants.SEND_OP_SLEEP_TIME); }
                        // I've tried the sleep time = 100, 500, 1000 milliseconds
             catch( InterruptedException ix ) {}
        class SendThread implements Runnable, Serializable {
         SendThread() {
             (new Thread(SendThread.this)).start();
         public void run() {
                URLConnection uc = url.openConnection();   
                // Various things get done with the url connection
                allDone = true;
    }

    Instead of your method and inner class try this :
    public void sendURL(URL url) {
         this.url = url;
         Runnable sender = new Runnable() {
              public void run() {
                   URLConnection uc = url.openConnection();
         SwingUtilities.invokeLater(sender);
    }I hope this helps,
    Denis

  • Apple TV not quite right, restarts needed often - are they all this way?

    I have a 40GB Apple TV that I keep in 'Sync' mode with my Mac Pro iTunes library. Most of the time, about 65%, the Apple TV works just fine. But the other times here are the odd and random issues I get:
    • When buying TV Shows or movies I get an "Accessing iTunes Store" that just sits there spinning forever. A restart often solves the issue, and sometimes after the restart the "Ready to Play" dialog box pops up first thing.
    • After waking the Apple TV after a day of inactivity, I will go to play an encoded movie (that is coming from the Mac Pro) and Apple TV will say "File type not supported" or something like that. Waiting 5 minutes, or restarting, fixes the issue and the very same movie file plays fine.
    • Though mine is set to 'sync' within iTunes, this still allows me to play movies and music via 'streaming'. But this is very inconsistent. Sometimes streaming will be very fast and movie playback (even HD) will start immediately. Other times it will take FOREVER to begin movie playback - the progress bar loads but literally moves about 10% per minute.
    • Why are some TV shows there right away, and others not at all? For instance, Modern Marvels : "new" shows playing on TV are picked up my DVR, but they don't ever seem to show up on iTunes?
    Any thoughts on the above issues are GREATLY appreciated... I've had this awhile and it's really been a lot of headache so far.

    Yes, I changed the channel to 6 (as was recommended in another post) and restarted everything. Worked fine (as usual) for a couple days. Went to get a couple new shows and it did the same "Accessing iTunes" message again - I let it spin for a good 2 mins and then retried. Spun for another minute or so with no change. So cancelled out, restarted Apple TV, went back to same show and bought it right away with no issues.
    FRUSTRATING. Literally, I must restart 2 times per week, sometimes more. Sometimes less.
    Our primary goal was to let Apple TV replace our DirecTV service. We really hate commercials! LOL - but with not much luck on the Apple TV, I think we'll need to wait until Apple spends more time on this thing.
    Mine's on eBay, so for now the problem is solved. Thanks for the replies...

Maybe you are looking for

  • How to see the balance under different balance if special ledgers exist???

    Some of the company using special ledgers. I need to teach user how to see the balance under different balance. I will focus on 1. display voucher 2. check GL balance Anyone have idea (detailed flow)/template (preferred) on these issues? Thanks a lot

  • Error while Executing Process chains

    Hi All, Initially i have created infopack with full load and Executed it manually, later i have changed same infopack to Delta load and kept in Process chains, when i execute the Process chains, the start Process have get triggred, but my Process sto

  • Trying to link to a specified frame

    Hi first of all sorry for my english ;-) i konw that its possible to link from a html link, via javscript, to a specified frame in a swf, but im looking since yesterday and cannot find something to help me ( yes i found something like this but to com

  • Playing iPod connected to 24/7 power

    Hey guys, I need help. My iPod mini displays "no battery power remains connect to power" or watever but the simple fact is that i actually have heaps of battery power. I found the iPod useless to me, and decided to get a new one. My dad paid for the

  • Email notification in a trigger

    I am trying to create a simple trigger for a table that has only one row. This is for a 10g database. I can't figure out how to send e-mail. I believe there is some kind of package that i have to include. Any help would be appreciated. Thanks. Shawn