Problem with repaint of display after a click event

Hi,
I have a problem with repaint of display. In particular in method keyPressed() i inserted a statement that, after i clicked bottom 2 of phone, must draw a string. But this string doesn't drawing.
Instead if i reduce to icon the window, which emulate my application, and then i enlarge it, i see display repainted with the string.
I don't know why.
Any suggestions?
Please help me.

modified your code little
don't draw in keyPressed
import java.io.IOException;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
public class PlayerCanvas extends Canvas implements CommandListener{
     Display display;
     Displayable dsp11;
private Image play, pause, stop, next, previous = null;
private int gamcode;
private Command quitCmd = new Command("Back", Command.ITEM, 1);
public PlayerCanvas(Display display,Displayable dsp11){
     this.display =display;
     this.dsp11 =dsp11;
     addCommand(quitCmd);
     createController();
     setCommandListener(this);
     display.setCurrent(this);
          protected void paint(Graphics g)
          g.setColor(255,200,150);
          g.fillRect(0, 0, getWidth(), getHeight());
          if (play != null){
          g.drawImage(play, getWidth()/5, getHeight()-50, Graphics.BOTTOM | Graphics.HCENTER);
          if (stop != null){
          g.drawImage(stop, getWidth()/5, getHeight()-10, Graphics.BOTTOM | Graphics.HCENTER);
          if (next != null){
          g.drawImage(next, (getWidth()/5)+10, getHeight()-30, Graphics.BOTTOM | Graphics.LEFT);
          if (previous != null){
          g.drawImage(previous, (getWidth()/5)-30, getHeight()-30, Graphics.BOTTOM | Graphics.LEFT);
               /////this will draw on key UP
               g.setColor(0,0,0);
               System.out.print(gamcode);
               if(gamcode==Canvas.UP){
                    g.drawString("PROVA",10, 0, 0);
               }else if(gamcode==Canvas.DOWN){
                    g.drawString("DIFFERENT",10, 30, 0);     
private void createController()
try {
play = Image.createImage("/icon3.png");//replace your original images plz
pause = Image.createImage("/icon3.png");
stop = Image.createImage("/icon3.png");
next = Image.createImage("/icon3.png");
previous = Image.createImage("/icon3.png");
} catch (IOException e) {
play = null;
pause = null;
stop = null;
next = null;
previous = null;
if (play == null){
System.out.println("cannot load play.png");
if (pause == null){
System.out.println("cannot load pause.png");
if (stop == null){
System.out.println("cannot load stop.png");
if (next == null){
System.out.println("cannot load next.png");
if (previous == null){
System.out.println("cannot load previous.png");
          protected void keyPressed(int keyCode)
               repaint();
               if ( (keyCode == 2) || (UP == getGameAction(keyCode)) ){
                    gamcode = UP;
                    repaint();
                    else if ( (keyCode == 8) || (DOWN == getGameAction(keyCode)) ){
                         gamcode =DOWN;
                         repaint();
          else if ( (keyCode == 4) || (LEFT == getGameAction(keyCode)) ){
          else if ( (keyCode == 6) || (RIGHT == getGameAction(keyCode)) ){
          public void commandAction(Command arg0, Displayable arg1) {
               // TODO Auto-generated method stub
               if(arg0==quitCmd){
                    display.setCurrent(dsp11);
}

Similar Messages

  • Problems with your HP printer after upgrading to Windows 8.1

    If you are experiencing problems with your HP printer after upgrading to Windows 8.1 please click on the below link and install the HP Print and Scan Doctor and run the utility to fix the issue.
    www.hp.com/go/tools.
    I was an HP employee
    If I have helped you solve your issue please mark it as solved
    **Say Thanks By Clicking on the Kudos Star**

    Hi.....my laserjet 1536dnf mfp was working perfectly with win 8 pro....then I installed win 8.1 pro and now the computer ,which is part of a network,can not communicate with the scanner of the printer--it prints just fine. On another computer (running win 7 ) on the same network, the scanner and all other printer functions  work just fine.
          I have tried installing the latest drivers from HP......scanner still not "communicating" with computer.....also temporarily disabled firewall.....please help...all the best -David G (gossat)

  • I have Windows 7 and just recently experienced a problem with itunes freezing up when I clicked on the "apps" tab.  Everything else seems to work okay in itunes.  I have uninstalled it and reloaded it 4 or 5 times, but still freezes up.

    I have Windows 7 and just recently experienced a problem with itunes freezing up when I clicked on the "apps" tab which shows the apps that are loaded on my phone.  Everything else in the itunes software seems to be working okay.  The problem is in the part where you sync the newly purchased apps.  The apps will all be blank that are downloaded and that part of the software crashes itunes or freezes up.  I can get out of itunes okay after the freeze up, but it just stops me from syncing anything that I have newly added.  If anyone has had this problem before or knows someone that has, please let me know how I can fix it.  I have uninstalled and reloaded itunes 4 or 5 times, but the problem is still there.  I might add that I have been using itunes and purchasing apps for 2 to 3 years without any problems.  HELP.

    You would get better response from the iTunes community forum.
    Have a nice day!

  • Problems with HP Probook 6475b after swiching computer off during full system restore

    Can anyone help?I have a problem with my HP Probook after it was accidently switched off during the running of an inbuilt recovery disc to restore the computer to its original instalation. When I switch it on now it goes straight to a message that says 'Windows is loading files' and after a short while comes up with a screen which says: Windows 7RECOVERY DISC***WARNING***You are about to erase your hard drive. click the greencheck box to proceed. Performing this action will restorethe computer back to it's original Windows installaltion there is the choice of three check boxes - one green with a tick, one red with a cross and one c:\ When I click the green box after about 5 seconds  there is a dialogue box entitled ' Restore Error Message'and in the box it states Error 1, with a box to click that says 'ok' If I click the ok box it returns back to the same message that Windows is loading files and goes through the same loop.I cannot get past this point. If I click the c:\  box it goes to  a black dialogue box which has the following: Microsoft Windows [Version 6.1.7600]X=\windows\system32> If I put sfc/scannow the message is as follows: There is a system repair pending which requires reboot to complete.  Restart Windows and run sfc again Can anyone advise how I can get out of this 'Error 1' loop and complete the system restore?   

    I do have a backup of the files, but the biggest issues come with the computer shutting down. I try to save frequently, but it makes it very tedious when I have to wait for the computer to reload, relaunch photoshop and redo my work. These frequent interruptions are hurting my productivity.

  • I have a problem with the touchsmart 420pc, after a running time (2 hour approx) is turned off,

    good afternoon, I have a problem with the touchsmart 420pc, after a running time (2 hour approx) is turned off, probably warming, but this rare, is suddenly going slow parapadear and image.
    also sounds like when damaged ballasts for lamps,
    ANYONE know what could be the cuasa and / or what is causing this.
    greetings and thanks in advance

    Hi,
    Please write your TouchSmart model number, which system are you using and country of purchase.
    Resource:
    How Do I Find My Model Number?
    ** Say thanks by clicking the "Thumb up" icon which is on the left. **
    ** Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue. **

  • Having problems with Bridge shutting down after saving photo in PS Cs5,,,,,,,,,  Also when i attempt to update either PS or bridge get an error message in Adobe application manger "Error loading updater workflow"

    Having problems with Bridge shutting down after saving photo in PS Cs5,,,,,,,,,  Also when i attempt to update either PS or bridge get an error message in Adobe application manger "Error loading updater workflow"

    Sorry for the late reply. My email firewall has become a little over zealous & sent a lot of my emails straight to my junk email folder, so I have only just now discovered your reply in my junk mail folder.
    The only "don't open files exceeding xxx megabytes" instruction I can find in my Prefs, is in the Bridge Prefs for Thumbnails, & mine is set at 1000mb. The biggest files I handle are bigger than 200mb so I should be able to open a few, not just one.
    However, this doesn't explain why I can open a psd format file of 180mb, close it, but then can't open a RAW format file of only 26mb immediately after.
    I can open the RAW file only if I restart my computer - very annoying!
    However, thanks for the advice about the video card & memory.
    So, I'm still stuck as to what the issue is.

  • Problem with Rescue and Recovery after installing Norton Internet Security 2010

    Hi all.
    It's my first time in this forum.
    I have a problem, with Rescue and Recovery, after installing Norton Internet Security 2010 on my T43.
    The message I get it:
    "Rescue and Recovery is unable to back up the file 'C:\Documents and settings\all Users\Application Data\ Norton\ 00000082\00000109\000003c1\cltMLS1.bat' Because the file is either corrupted or being used by another application. Please close any application that could be using the file.
    I tried to close the Norton but I couldn't find how.
    Tanks
    Doron71

    Hi and welcome to the forum,
    the reason for this situation is, that the antivir files are protected from being modified.
    This is the reason, why this file cannot be backed up. I assume, that you would get much more such messages, as there are surelly multiple files files, that are protected like this.
    So the solution is to block folders from being archived. Please start RnR application and in the configuration set this folder as the excluded one.
    This will skip the backup of this file and will fix your situation.
    Please let me know, if you have covered this.
    Cheers

  • Problem with Facebook and instagram after istalling iOS 7.1. Can not open them!

    Problem with Facebook and instagram after istalling iOS 7.1. Can not open them!

    Hi Hanjon!
    Here is an article that will help you troubleshoot these purchased apps:
    iOS: An app you installed unexpectedly quits, stops responding, or won’t open
    http://support.apple.com/kb/ts1702
    Thanks for being a part of the Apple Support Communities!
    Regards,
    Braden

  • Problem with flash on IE11 after using adobe cleaner

    Problem with flash on IE11 after using adobe cleaner to remove a trial version of photoshop because there was not any entry on add/remove applications in windows 8.1
    Its to frustrating to reinstall everything. I tried everything from your support page with no luck…

    Link for Download & Install & Setup & Activation problems may help
    -Online Chat http://www.adobe.com/support/download-install/supportinfo/

  • I am having problems with my music collection, after burning all of my music to the computer I organized it into folders and placed it in the iTunes Folder. Starting on a new computer now. I can get my music from old computer?

    I am having problems with my music collection, after burning all of my music to the computer I organized it into folders and placed it in the iTunes Folder. As of now i realize this was a mistake. Starting on a new computer now. I cant get my music to transfer from the itunes folder on the old computer? I keep getting error "Can't Read from the source file or disk." Whenever I got to folder properties its always checked read only. But when i play the song it works just fine. Im sure this is just because I added music into itunes folder but is there anyway to fix it?

    WMA files are 'window media audio' files, which is a Microsoft format. If you want to add them to your iTunes library on your Mac then you will need to convert them into a compatible format first. If you still have your windows machine then iTunes for Windows can convert them from WMA to MP3 format : https://discussions.apple.com/message/24158701#24158701
    Or try a search for, for example, 'convert wma to mp3' to find programs to convert them.

  • How do i get a new tab to open up with my home page after i click on the + at the end of the tab

    how do i get a new tab to open up with my home page after i click on the + at the end of the tab

    problem solved thak you Andy.c that was too easy and a fast reply i'm abit of an iliterate with these things

  • Strange problem with my ipod 2g after upgrade to os 4.2

    Strange problem with my ipod 2g after upgrade to os 4.2
    the problem with volume some times when i switch on the ipod i hear the sound
    alarm rings it's work too i can hear it .. but the problem i cant hear anything else as yourtube or music i cant hear buttons sound when i typing
    i hope i get help

    I would try in order:
    - Reset the iPod:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Restore the iPod from backu via iTunes.
    - Restore the iPod to factory defaults/new iPod.

  • Solutions for problems with QuickTime files in After Effects CC (12.0)

    We have a new blog post up about solutions for problems with QuickTime files in After Effects CC (12.0) because of conflict with DVCPROHDVideoOut QuickTime components. 
    Please read that post and let us know here on this forum thread if you have any questions or comments. 
    Also, please let us know if the proposed solution works for you.

    Mark - The new document that we published is meant to address a specific issue. You can confirm you have the issue by the following:
    Adobe QT32 Server is not running when you receive these errors. Keep Activity Monitor open to track whether or not it is running.
    The crash log for QT32 Server indicate CoreAudio as the last component called. You can find the crash logs in Users/username/Library/Logs/DiagnosticReports. The report will look like this:
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   ???                                     0x04981f90 0 + 77078416
    1   com.apple.audio.CoreAudio               0x949d05c1 __Call_block_invoke_03 + 56
    2   libdispatch.dylib                       0x94a90f8f _dispatch_call_block_and_release + 15
    If this is not the issue you're having, please start a new thread and provide the usual data. If your problem does match this issue, please double-check that you've followed the steps in the new document and post back here.

  • I have a problem with a chart refreshing after its bound data provider changes.

    I have a problem with a chart refreshing after its bound data
    provider changes. After the subsetHighLowData.refresh() is called I
    would expect the chart to redraw, but it still looks the same. I
    even inspected the debugger to see if the slice had taken place and
    it had.
    Any ideas coding friends?

    "nikos101" <[email protected]> wrote in
    message
    news:gib6aa$prr$[email protected]..
    >I have a problem with a chart refreshing after its bound
    data provider
    >changes.
    > After the subsetHighLowData.refresh() is called I would
    expect the chart
    > to
    > redraw, but it still looks the same. I even inspected
    the debugger to see
    > if
    > the slice had taken place and it had.
    >
    > Any ideas coding friends?
    >
    > subsetHighLowData.source =
    >
    highLowData.source.slice(slider.values[0],slider.values[1]);
    Just use the ArrayCollection's removeItemAt, and it should
    handle the event
    dispatching for you.
    HTH;
    Amy

  • Problem with hotmail calendar display

    Problems with hotmail calendar display.

    I am almost a total computer novice and am having what I think is the same problem  Just got my first Apple computer (Macbook Pro).  MSN Hotmail is my email account.  All the events on my 'hotmail' account are now unreadble because they are squished to the left side of the screen and I don't find any instructions as to how to fix this in the system. This problem didn't exist when I first started using my MAC two days ago, but now I'm stuck.  Everything else in my 'hotmail' seems to work fine.  Don't know what Chrome or Firefox is or if there is a cost for them.  Also, have never downloaded a program if any kind.
    My calendar is critically important to me and I don't have a clue as to what to do now.  Hope you can help.
    Thanks.  Linda

Maybe you are looking for

  • AMD Radeon(TM) HD 7650A Graphics Driver that supports Miracast

    Please  Anyone with any infomation as when will HP and  AMD release a new Display driver with Miracast support, would be very much appreciated. DxDiag on this cards driver is as follow: Display Devices           Card name: AMD Radeon(TM) HD 7650A Gra

  • MS Office on a Mac - wont safe docs/too many doc open

    Could anyone tell me why "word" or "excel" will not save documents and the error message that is received is "word cannot complete the operation because too many file are open (doc)" We have several Macs connected to a PC server/network. Generally wh

  • Weblogic Server 7.0 - CipherIsExportable

    Hi, I need a small help. In weblogic7.0 when I set Ciphersuites="TLS_RSA_WITH_AES_128_CBC_SHA" at config.xml file, the server console shows : <Alert> <WebLogicServer> <000297> <Inconsistent security configuration, java.lang.NullPointerException> java

  • How to set relative position in Crystal Reports

    Hi We are using CR XI R2 for designing crystal reports and Oracle 9i as datasource. we have placed 5 columns in vertical position next to one another in details section. for ex Salesrevenue Company description SalesSummary as data fetch is dynamic wh

  • How to read partner funtion for campaigns using bapi.

    Hi, I want to find out open campaigns and marketing attributes based on partner function i.e., employee responsible and these open documents I need assign to another employee responsible. Which function module I need to read the details and which fm