Displaying text on screen while connecting not working

Hi all,
I'm building a game to be played over Bluetooth. While the connection is made, I want to display a text message to the user stating the connection is made. Everything seems to work allright, but the messge is not shown. What goes wrong?
Some code. I have a MyMIDlet, that creates MyGame. The MyGame object is responsible for creating the connection. MyGame implements Runnable
public class MyGame implements Runnable {
     // Some code omitted
     public void run() {
          createSplashScreen();
                 // More code omitted
     private void createSplashScreen() {
System.out.println ("myGame.createSplashScreen, informing players on connection process");          
          String[] message;
          if (isServer) {
               message = new String[5];
               message[0] = "Waiting";
               message[1] = "on an";
               message[2] = "Opponent";
               message[3] = "to Join";
               message[4] = "the Game";
          else {
               message = new String[3];
               message[0] = "Searching";
               message[1] = "for a Game";
               message[2] = "to Join";
          // Create the canvas and set it to the current display
System.out.println ("myGame.createSplashScreen, creating SplashScreen");
          mySplashScreen = new MySplashScreen(message, FONT);
          mySplashScreen.addCommand(myMIDlet.getExitCommand());
          mySplashScreen.setCommandListener(myMIDlet.getCommandListener() );
          myMIDlet.setCanvas(mySplashScreen);
          mySplashScreen.repaint();
     }The previous code creates a MySplashScreen object:
public class BluePongSplashScreen extends Canvas {
         // Code omitted
     public MySplashScreen (String [] theMessage, Font theFont) {
          messageLength = theMessage.length;
          message = new String [messageLength];
          System.arraycopy(theMessage, 0, message, 0, messageLength);
          font = theFont;
          // Get dimensions screen
          width  = getWidth();
          height = getHeight();
          // Start displaying message at first position
          messageIndex = messageLength - 1;
    public void showNotify() {
System.out.println ("mySplashScreen.showNotify, creating new mytTask");
         mytTask = new MyTimerTask(this);
        new Timer().scheduleAtFixedRate(mytTask, 1500, 1000);
     public void paint (Graphics graphics){
System.out.println ("mySplashScreen.paint, repainting message screen");          
          int textX = width/2;
          int textY = height;
          // Clear screen
          graphics.setColor(COLOR_LIGHT_BLUE);
          graphics.fillRect(0, 0, width, height);
          // Set font color
          graphics.setColor(COLOR_WHITE);
          // Write message word by word on the screen
          messageIndex = messageIndex % messageLength;
          for (int i = 0; i <= messageIndex; i++) {
System.out.println ("mySplashScreen.paint, message[" + i + "]=" + message);
               graphics.drawString(message[i], textX, textY,
                         Graphics.TOP | Graphics.HCENTER);
               textY += font.getHeight();
And then the last code of the problem, the MyTimeTask object:
public class MyTimerTask extends TimerTask {
      * The canvas repainted periodically
     private MySplashScreen mysScreen;
      * Constructs the timer task
      * @param theScreen the canvas to be repainted
     public MyTimerTask (MySplashScreen theScreen) {
          mysScreen = theScreen;
      * Task that repaints the splash screen
     public void run () {
System.out.println ("mytTask.run, increasing message index");
          mysScreen.increaseMessageIndex();
          mysScreen.repaint();
}Here is some logging I copied from the text box of the WTK25 window:
myMIDlet.commandAction: Thread myGame ended.
myGame.createSplashScreen, informing players on connection process
myGame.run: isGameCompleted=false
mySplashScreen.showNotify, creating new mytTask
mySplashScreen.paint, repainting message screen
mySplashScreen.paint, message[0]=Waiting
mySplashScreen.paint, message[1]=on an
mySplashScreen.paint, message[2]=Opponent
mySplashScreen.paint, message[3]=to Join
mySplashScreen.paint, message[4]=the Game
mytTask.run, increasing message index
mySplashScreen.increaseMessageIndex, index=5
mySplashScreen.paint, repainting message screen
mySplashScreen.paint, message[0]=Waiting
mytTask.run, increasing message index
mySplashScreen.increaseMessageIndex, index=1
mySplashScreen.paint, repainting message screen
mySplashScreen.paint, message[0]=Waiting
mySplashScreen.paint, message[1]=on an
mytTask.run, increasing message indexSo clearly, the objects are created, and doing (almost) all their work, except displaying the text on the screen.
Anyone knows how to solve this problem?
Maik

A Reset should help.
If youre on nano 6th gen:
Press and hold the Sleep/Wake button and Volume Down button simultaneously for at least eight seconds or until the Apple logo appears. You may need to repeat this step.

Similar Messages

  • [SOLVED] 'Dim screen while inactive' not working

    I have a sony vaio with GNOME 3. I suppose when it's not on AC power the screen should dim (it's ON on the Power Manager), but I wait and the screen's brightness doesn't drop a bit... I have another laptop, acer with Fedora 20 MATE, after a short while inactive the brightness drops. Which one is the culprit here?
    edit: possibly a hardware hickup. When I start the system with the AC adapter off, everything works fine.
    Last edited by lmello (2014-07-13 00:55:48)

    In case anyone's interested:
    i am now running gnome-shell on the big monitor, and openbox on the secondary monitor by calling the appropriate sessions from .xinitrc with the right display:
    #!/bin/sh
    DISPLAY=:0.0 exec openbox-session &
    DISPLAY=:0.1 exec ck-launch-session gnome-session
    It is important to call openbox first, otherwise gnome-shell tries to seize control over both screens (and fails to do so).
    two little drops of bitterness remain:
    1. I had to connect both monitors to the same device, because the one connected to the onboard chip was flickering really bad. this is probably unrelated, though.
    2. I can't use gnome-shell as a login-manager (maybe in fallback-mode i could, but i don't want that), so now i am logging in from tty and then startx

  • Text-to-speech engine is not working

    when I want to use 'read out loud' in adobe reader and  foxit , I'm get no sound, I have similar problem in babylon that using TTS engine of OS.
    I'm using windows 8.1 64 bit.
    Do not get any error, but when play would have no sound.
    I previously didn't have any problem with these softwares.
    really need this functionality, please help me.
    Babylon support
    told me::
    Babylon uses a free text-to-speech engine that was developed by Microsoft and is part of Windows OS. please check with Microsoft support , why your text-to-speech engine is not working.

    Hi,
    If you go to the Start Screen, search for "Narrator" within All Apps and click it, what happens?
    In addition, please follow the steps below to check Speech Properties if there is anything wrong with it.
    Control Panel\Ease of Access\Speech Recognition\Advanced speech options
    Roger Lu
    TechNet Community Support

  • HT204065 Group text with one non iPhone not working on iPhone 6 in the group.

    Group text with one non iPhone not working on one iPhone 6 in group. SMS, MMS and iMessage as well as group messaging are all turned on. Has worked intermittently but now cannot see or respond in that particular chain. Can send independently to the non iPhone (Samsung) but not in group. Other iPhone 6 and 5 in group work fine.

    The reason why you have to turn off 3Gs is because T-Mobile does not support iPhones 1700 something or other. You have to turn off the 3Gs on the iPhone to make it work.
    As already provided, it shouldn't matter since the iPhone is designed to automatically connect to the fastest internet connection available. If wi-fi access and 3G network access is on, when in range of an available wi-fi network you have access to and have connected your iPhone with previously, the iPhone will connect to the wi-fi network automatically. When leaving the range of the wi-fi network, the iPhone will connect to the 3G network if 3G network access is available. If 3G network access is not available, the iPhone will connect to EDGE or GPRS - whichever is available at the time.
    If this is unique to T-Mobile's network with the iPhone for some reason since T-Mobile is not an official carrier for the iPhone in the U.S. and you were instructed by T-Mobile to do so, then you need to do so.
    If this is not working now, the problem lies with T-Mobile and I have no idea what to tell them for them to recognize where the problem lies on their end.

  • IChat 4.0.7 Screen Sharing does not work.

    Me and my friend both have identical machines, the intel iMac 20" 2.66mhz
    Software is identical
    iChat version is identical (4.0.7 (616))
    Video Chat works perfectly, our internet connections are fantastic, no issues there.
    Both using Netgear routers with uPnP enabled.
    Internet Sharing is OFF
    Firewall is "set access for specific services and applications" and iChat and iChat Agent are added.
    I conclude that Screen Sharing *does NOT work* as advertised.
    Apple, I am most disappointed, get it sorted for next release please.
    Who else has witnessed this epic failure?
    Thanks,
    edit
    Also, what is this iChat AV nonsense? Where are the iChat 4 forums?
    Message was edited by: Wayne

    Thanks again Leo for your help,
    Yes I was refering to the screen sharing in system preferences/sharing.
    Checked the video menu:
    Screen sharing enabled
    Camera enabled
    microphone enabled
    so no that's not it! Was hoping it was something simple like that too.
    Both netgear routers dont have any ports forwarded, just upnp enabled.
    The frustrating thing is, both macs are new, one is only days old, and neither mac has had it's setting messed about with or anything.
    It would be great to find the solution, 100's of people having similar issues if you google it.
    *edit*
    Just a thought, would the type of account make a difference? At the moment we are both using the type of accounts that iChat creates when you select "get an iChat account" (creates a [email protected] login)
    Message was edited by: Wayno

  • X-Fi Titanium PCI Express front pannel connection not working

    <font face="verdana,geneva" size="3">I can not get any signal to or from the front pannel connector of my X-Fi Titanium PCI Express. (The rear jacks are working fine.)
    <font face="verdana,geneva" size="3">The front header cable from my Antec P-80B worked perfectly with my onboard motherboard sound. Now that I have it connected to my X-Fi I get nothing from the jacks on the front of my case. (The onboard sound is disabled in my BIOS.)? I've double and tripple checked the connection and it is properly keyed and fitted. Is there a step or a setting that I'm missing somewhere to get this working? Can anyone confirm that the front pannel connection is acti've on the X-Fi Titanium PCI Express?

    Re: X-Fi Titanium PCI Express front pannel connection not working? I was truly hoping that would help and I wanted to give you some additional hope. I have a coolermaster case, and it has the AC97 jack on the inside with all my other other front panel connectors for hard dri've activity light, reset, and power on. Three inches down from the AC97 jack, the INTEL HD *which works beautifully with the X-FI, only differs by three wires in different locations and the two pinouts configurations match those of the INTEL site identically.
    Please tell me what happens as I would like to post a step by step guide for the others here in the forum. You will know when you have successfully adapted the connector because in VISTA and Windows 7, your sound applet in control panel will have a display of the connectors "lit up" when they are successfully connected. Mine shows FP microphone in the applet when its plugged in, and grayed out when its not. Its great for telling if I am connected on the rear of the soundcard of the front.
    Best of luck and .......
    Message Edited by jmacguire on 07-06-2009 :09 PM

  • I cant copy/paste from an article to my web site, get a Mozilla Rich Text Editing demo page will not work.HELP

    Tried to copy/paste from an article to my web site and got a "cannot copy /paste " warning and was directed to a security perferences site that said that Mozilla Rich Text Editing demo page will not work.
    Tried to find my Firefox profile directory using the start menu and was directed to hit enter to go to web. Feel like i am getting run around.

    Let's start with something very basic, and that is, you do not need to use the paste button on most websites. The button just reads what is on your clipboard and sticks it into the form. You can do that yourself using Ctrl+v or right-click>Paste.
    For your security, I suggest using those standard Windows keyboard shortcuts (Ctrl+x cut, Ctrl+c copy, Ctrl+v paste) or the context menu.
    Occasionally you will find a paste button that runs a clean-up script or otherwise does something useful. That is where the (admittedly a bit complicated) instructions come in handy.
    To open your active profile folder, you can use:
    Help > Troubleshooting Information > "Show Folder" button
    Which help article are you using for the modifications?
    Finally, please be cautious in opening up your clipboard to sites. You may have stuff you copied from other pages or other programs that you do not want to share with most sites.

  • My lock screen button is not working and i turned off my iphone with assistive touch. Now i cant turn my phone back on!

    I used assistive touch to turn off my iphone, because my lock screen button is not working, so now i cant turn it back on! What i did was, i went to assistive touch, then i held down the lock screen button to turn it off. Now i can't turn it back on.

    To turn it back on when you use assistive touch, all you have to do is plug your iphone into a charger and it will power back on

  • What's going on with ios8... Screen rotate does not work anymore, wifi doesn't work very well anymore and apps are crashing or running slow... Come on Apple sort this mess out

    ssince I updated my iPhone 5s to ios8 ive had nothing but problems...
    first the the screen rotation is not working... Checked the settings and  lock is off.... The wifi is intermittent, some times it works sometimes it doesn't....
    the he iPhone is really slow now, like really labouring.... It hangs and crashes all the time.... I have to close apps down completely because they won't work from quick launch anymore.... Even writing this the phone is labouring.... It's like my old 48k spectrum.... I don't expect this from Apple and when you spend £400-500 on a phone you expect it to work and play propperly....  come on Apple you need to sort out this mess of a update.... Ios 7 was no bother......

    Same issue here... iphone5S 64GB.  It's intermittent.  Sometimes the rotation works fine, sometimes it doesn't, but most of the time it doesn't work.
    The first time I figured out it wasn't working was when all newly-taken photos and videos were showing up in portrait mode though I always hold in landscape mode when photographing.
    Rotation lock is disabled (tried toggling it on and off).  Tried recalibrating the compass on a whim, no effect (although my compass seems to always require calibration when it's launched now).
    This issue only started happening after upgrading to iOS8.  I did a reset/restore through iTunes rather than an OTA upgrade.
    UPDATE - power-cycling the phone seems to fix it temporarily.

  • My passcode is working to unlock the screen but does not work with restriction passcode. Should they be different?

    My passcode is working to unlock the screen but does not work with restriction passcode.
    Tried it several times but it did not work, though i can use the phone and all features even after 13 failed attempts.
    Should restriction passcode be different from what i set?

    There is no default restriction password. If you didn't set it someone else may have. If you can't find it then you may have to follow the steps here:
    Forgot passcode for your iPhone, iPad, or iPod touch, or ...
    Do you have a backup which might not have this restriction passcode? If so restore to that backup?

  • Photoshop: full screen mode shortcut not working

    photoshop: full screen mode shortcut not working, if i press shirt+alt+ctr key then i delete the file, what happen ?

    Could you elaborate?
    F is the default shorcut for »Change Screen Mode« for me, so I’m not sure what you want with the qualifier keys.
    Have you changed your Edit > Keyboard Shortcut?

  • Camera connection not working with my camera

    Camera connect not working with my Sony boggie camera

    The Bloggie will not work because it draws too much power from the USB port on the iPad.  The solution is to interpose a powered USB hub between the Bloggie and the iPad - connect the Bloggie to the powered hub, then connect the hub to the ipad accessory.  Works fine with my 3D Bloggie.

  • Save Panel Image / Screen Image does not work as an Executable

    The Save Panel Image / Screen Image does not work as an Executable.  It looks like there is a conflict with the Path, since the Screen_Image.exe is launched as Screen_Image.vi.  I've tried this function both ways with the path name change Screen_Image.exe AND Screen_Image.vi.

    Any chance you might be able to post some code illustrating what you are talking about?
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Apple iPAD 2.  Needs password to unlock iPAD; however there is a permanent keyboard displayed on the screen that does not respond to touch. iPAD switches on with button but does not turn off using it at moment.  Can you help please?

    Apple iPAD 2.  Needs password to unlock iPAD; however there is a permanent keyboard displayed on the screen that does not respond to touch. iPAD switches on with button but does not turn off using it at moment.  Can you help please?

    Try a reboot by holding both the power and home buttons until the apple logo appears, ignore the red slider if that appears.  See if that clears the glitch.

  • I am facing a new problem after a missed call. i phone will get freez on its lock screen after a miss call. Its seems that its main screen touch is not working properly.  This problem occurs after each and every missed call.

    I'm using iphone 5s with ios 7.1.2  & I am facing a new problem after every missed call. i phone  gets freezed on its lock screen. It seems that its main screen touch is not working properly. It should be bug introduced by apple . This problem occurs after each and every missed call .There is no patch announcement for this issue yet. There are few workaround to fix this issue: Reboot your iphone. But its  irritating to reboot the phone frequently after each issue....

    Hello dipthebe,
    Check out the articles below go through troubleshooting steps for your iPhone when the screen is unresponsive. You may want to try and restore your iPhone as a new device and then test out what happens when you miss a call to see if the issue is still present afterwards.
    iPhone, iPad, iPod touch: Troubleshooting touchscreen response
    http://support.apple.com/kb/ts1827
    Use iTunes to restore your iOS device to factory settings
    http://support.apple.com/kb/HT1414
    Regards,
    -Norm G.

Maybe you are looking for