Can anybody help me with this code?

I am a beginner to J2ME. The following is a small program I wrote just for test.
Theoretically, in my opinion, I shall see in the screen a number increase from 1 to 29999 rapidly after execute the code. But instead, it displays nothing but only displays 29999 after several seconds . Can some body point out what's wrong with this code? Thanks.
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Test extends MIDlet{
int x=1;
String b="";
private Display display;
public Test() {
display = Display.getDisplay(this);
public void startApp() {
MyCanvas mc = new MyCanvas() ;
display.setCurrent(mc) ;
while(x<30000){
b=String.valueOf(x);
mc.repaint();
x++;
public void pauseApp() {
public void destroyApp(boolean unconditional) {
class MyCanvas extends Canvas{
public void paint(Graphics g){
g.drawString(b,10,10,0);

thanks, I have already got the answer. you are right, if repaint in a high speed the screen will show nothing. here is the code for it, thanks the expert of nokia forum.
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
//Counter
//Need to know when a number has been painted and need to wait a for a fraction of a sec before
//painting the next number. This wait also allows other events like "Exit" to be processed
//Use double buffering to avoid flicker
//Paint in a different thread to keep the UI responsive
public class MyMIDlet extends MIDlet{
int x=1;
String b="";
private Display display;
Thread t = null;
MyCanvas mc = null;
public MyMIDlet() {
display = Display.getDisplay(this);
public void startApp() {
mc = new MyCanvas();
t = new Thread(mc) ;
display.setCurrent(mc) ;
b=String.valueOf(x);
t.start();
public void callbackPaintDone(){
try{
//provides the delay between every repaint and also time to react to Exit
synchronized(this){
wait(1);
}catch(Exception e){}
paintNextNumber();
private void paintNextNumber(){
if(x<30000){
x++;
b=String.valueOf(x);
mc.doPaint = true; //signals that next number can be painted
public void pauseApp() {
public void destroyApp(boolean unconditional) {
class MyCanvas extends Canvas implements Runnable{
Image buf = null;
Graphics bg = null;
public boolean doPaint = true;
public MyCanvas(){
buf = Image.createImage(getWidth(),getHeight());
bg = buf.getGraphics();
public void paint(Graphics g){
bg.setColor(255,255,255);
bg.fillRect(0,0,getWidth(),getHeight());
bg.setColor(0);
bg.drawString(b,10,10,0);
g.drawImage(buf,10,10,Graphics.TOP|Graphics.LEFT);
// Callback for next number to be painted
MyMIDlet.this.callbackPaintDone();
public void run(){
while(true){
if(doPaint){ //only paints when a number has been painted, and next one is ready to be painted
doPaint = false;
repaint();
serviceRepaints();

Similar Messages

  • I urgently need a contact email for the sales team can anybody help me with this

    I urgently need a contact email for the sales team regarding an outstanding query, can anybody help me with this please? Thanks in advance.

    Hello 
    Welcome to the EE Community! I'm afraid there isn't an e-mail you can contact the EE Mobile Sales team on, but here's how you can get in touch with them:
    If you're on Twitter, you can tweet them @EE, however If you'd prefer to talk to someone, you can dial:
    150 from your EE mobile phone
    If you're ringing from another phone, it's 01707 315000
    For handy text codes & more, check out this page: http://ee.co.uk/help/get-in-touch Cheers,
    Titanium
    Was my post helpful? Please take 2 seconds to hit the 'Kudos' button below

  • I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?

    I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?    

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Can somebody help me with this code?

    Can anyone help me with this code? My problem is that i can't
    seem to position this form, i want to be able to center it
    vertically & horizontally in a div either using CSS or any
    other means.
    <div id="searchbar"><!--Search Bar -->
    <div id="searchcart">
    <div class="serchcartcont">
    <form action='
    http://www.romancart.com/search.asp'
    name="engine" target=searchwin id="engine">
    <input type=hidden value=????? name=storeid>
    <input type=text value='' name=searchterm>
    <input type=submit value='Go'> </form>
    </div>
    </div>
    <div class="searchcont">Search For
    Products:</div>
    </div><!-- End Search Bar -->
    Pleasssssseeeeeeee Help
    Thanks

    Hi,
    Your form is defined in a div named "serchcartcont", you can
    use attributes like position and align of the div to do what you
    want to do. But there are two more dives above this dive, you will
    have define the height width of these before you can center align
    the inner most div. If you are not defining the height & width
    then by default it decide it automatically to just fit the content
    in it.
    Hope this helps.
    Maneet
    LeXolution IT Services
    Web Development
    Company

  • I can't sign into iTunes on this pc so I can authorize it. I wan't to do this so I can transfer purchased iTunes music on my iPad mini to this pc. When I try to do this the response I get is just to try again later. Can anybody help me with this?

    I can't seem to sign into iTunes on this pc so that I can authorize it. I want to do this so I can transfer purchased iTunes music on my iPad mini to this pc. The response I keep getting is to try again later but its been days so I don't think that is the problem. I know I am using the correct user name and password so I don't know what's wrong. Can anybody help me with this?

    Hello
    It seems as though your account has been hacked.
    please contact Skype customer service and change your password.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • I want to delete OS X Lion and install OS X Snow Leopard again, can anybody help me with this?

    I want to delete OS X Lion and install OS X Snow Leopard again, can anybody help me with this?

    See Kappy's going back to SL from Lion guide.

  • I try to restore my ipod mini 4gb  but i get the 1437 error? can anybody help me with this problem?

    ok i have had the ipod fr a while and when i try and restore it gives me the 1437 error? i have no clue what this mean, can anybody help me? when is specifys the ipods components like the name and capacity etc.. under capacity it says N/A?  get back to me please i miss having an ipod:((

    I wish I could offer a solution, because I too am about to go crazy trying to fix the same problem. I have tried everything in the support section, sometimes twice, to no avail. Now I have an empty ipod that won't connect to my computer much less iTunes.
    Any suggestions?

  • I am trying to install a demo loop on a iPhone 5, can anybody help me with this?

    I am trying to download a demo loop for the iPhone 5, can anybody help me?

    I went to Setting, General, and reset, I select Reset all settings and contents and it asked me for a 4 digit code but when i use the one on my current iphone 5 id doest work.

  • Can someone help me with this code?

    Hi all,
    I have a Flash component that links to a gallery, and I
    understand that I can create buttons to point to multiple
    galleries. (waiting too long for support from the suppliers)
    The User Guide says that I can use the following to create
    the connection:
    myThumbnailer2.loadGallery(24);
    That won't work, and it says that I need to include it in an
    onclipevent. I have no idea what i am doing and I was hoping
    someone could tell me what to script to get the text button I
    created to run this.
    Help would really be appreciated.
    Hugh

    Hi Hugh,
    You are right in that you can link to other galleries using
    the ID number (but, I assume, only TN2Admin (fCMSPro gallery
    document) defined galleries) with the code supplied.
    I think this may help - I'm a newbie with actionscript and I
    know nothing about Flashloaded so I may be way off beam here,
    but....
    First define a variable, this will be used in the 'show'
    (that's show, not load) gallery element of your code:
    var galNum: Number;
    Make as many buttons as required to launch a gallery (you say
    "each button opening one of several galleries" so I assume you want
    1 gallery per button) and give each an instance name.
    You then write the relevant code for each button function
    (assuming once more that the buttons are in the same frame) using
    the instance name (I use a separate layer in the frame to write
    actionscript and try not to attach code directly to objects - which
    then leads me to say yes you can put all the different buttons code
    in one frame)....
    myLoadGalBtn1.onRelease = function () {
    myThumbnailer2.loadGallery(24);
    galNum = 24;
    myLoadGalBtn2.onRelease = function () {
    myThumbnailer2.loadGallery(25);
    galNum = 25;
    notice the buttons have different instance names (the 1 &
    2 at the end - but you can call them what you like).
    Then you can use other code supplied to actually show the
    gallery (using the variable generated in each button click). Some
    code from Flashloaded will be along the lines of:
    myThumbnailer2.showGallery(25);
    so my guess is you can replace the actual number with the
    variable galNum inside the brackets to use the number generated by
    whatever button was pressed, like:
    myThumbnailer2.showGallery(galNum);
    Cheers
    Kol

  • Can you help me with this code

    hi am new to java so please bare with me , so in this code as you can see i comment some lines of code the one i comment works when i compile it , but why the one with fields does not ? can you please explain this to me
    public class Demo3
                   public static int a = 5;
                   public static int b = 6;
                   public static int c = a+b;
                   public static int d = b-a;
                   a*=5;
         public static void main (String [] args)
              /*int a = 5;
              int b = 6;
              int c = a+b;
              int d = b-a;
              a*=5;
              System.out.println (a);
              System.out.println (b);
              System.out.println (c);
              System.out.println (d);
    }

    >
    public class Demo3
                   public static int a = 5;
                   public static int b = 6;
                   public static int c = a+b;
                   public static int d = b-a;
                   a*=5;This is not possible. write this statement in a function.
    or
    in a static block like
    static  {
          a*=5;
    }>
         public static void main (String [] args)
              /*int a = 5;
              int b = 6;
              int c = a+b;
              int d = b-a;
              a*=5;
              System.out.println (a);
              System.out.println (b);
              System.out.println (c);
              System.out.println (d);

  • Can anybody help me set this code into an array?

    Thanks, can you help me understand how to make an array work?
    I need to fade toggle a different country png for each country button and fade out the rest of the country images i.e.: when i click the UK button i need to fade toggle the UK png and fade out the other countries
    when i click the USA button i need to fade toggle the USA ing and fade out the other countries and so on
    sym.getSymbol("Countries").$("UK").fadeToggle();sym.getSymbol("Countries").$("USA","AUS","Hongkong","Switzerland","Ireland","Indias","Japa n","Netherlands","Spain").fadeOut();
    sym.getSymbol("Countries").$("USA").fadeToggle();sym.getSymbol("Countries").$("UK","AUS","Hongkong","Switzerland","Ireland","Indias","Japan ","Netherlands","Spain").fadeOut();
    etc
    but it doesn't seem to work how i have it and i have been told to do an array but I'm not sure how?
    Project here if you want to have a look:
    Dropbox - Countries.zip
    can you help?

    I think this[var = sym.getSymbol (Stanbuttons).$(".UK_stan, .USA_stan"); ] should be
    var myvar = sym.getSymbol (Stanbuttons).$(".UK_stan, .USA_stan");
    And than
    myvar.each(function(){
    $(this).fadeOut();

  • I have an iphone 6 and my ex partner is able to read my text imessages remotely without having access to my phone. How is this possible and can anybody help me with this matter as it is a gross invasion of my privacy?

    Hi everybody,
    I have an iphone 6 and  my ex partner is intercepting and reading my imessage text messages remotely and without any access to my phone. Can someone shed any light on how this is possible and if so provide me with a solution to my problem as this is a gross invasion of my privacy and i seem powerless to combat this problem!

    It sounds as if your ex has your AppleID and passcode. Change the passcode.

  • Can anybody help me with this crash report?

    In the past weed My mac restarted in the middle of working and came up with a message in a blanck white page saying: your computer has been restarted because of a problem.
    I've searched a little in the support community and I suspect that it is because I'm downloading some big files with Bittorrent.
    But if anyone can see my report and tell me whether it is ok and my Mac doesn't need any service and whether I can use Bittorrent anymore? I really apprieciate it.
    Thu Aug 29 23:33:43 2013
    panic(cpu 0 caller 0xffffff800f39e3f3): "soreceive: sb 0xffffff802a9e5d50 so 0xffffff802a9e5ce0 cc 68 mbcnt 2304 mb 0xffffff80f9612d00 mbtail 0xffffff80f9612d00 " "lastrecord 0xffffff80f9612d00\n"@/SourceCache/xnu/xnu-2050.24.15/bsd/kern/uipc_socket2.c:1 306
    Backtrace (CPU 0), Frame : Return Address
    0xffffff810018bd10 : 0xffffff800f01d626
    0xffffff810018bd80 : 0xffffff800f39e3f3
    0xffffff810018bdb0 : 0xffffff800f3985b4
    0xffffff810018beb0 : 0xffffff800f376cdf
    0xffffff810018bf20 : 0xffffff800f376c3a
    0xffffff810018bf60 : 0xffffff800f3e13b3
    0xffffff810018bfb0 : 0xffffff800f0ce6ad
    BSD process name corresponding to current thread: BitTorrent
    Mac OS version:
    12E55
    Kernel version:
    Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64
    Kernel UUID:
    Kernel slide:     0x000000000ee00000
    Kernel text base: 0xffffff800f000000
    System model name: MacBookPro9,1
    System uptime in nanoseconds: 3212462872091
    last loaded kext at 1009307156212: com.apple.filesystems.smbfs          1.8.4 (addr 0xffffff7f9142e000, size 229376)
    last unloaded kext at 316174873374: com.apple.filesystems.msdosfs          1.8.1 (addr 0xffffff7f91420000, size 57344)
    loaded kexts:
    at.obdev.nke.LittleSnitch          3932
    com.apple.filesystems.smbfs          1.8.4
    com.apple.driver.AppleHWSensor          1.9.5d0
    com.apple.iokit.IOBluetoothSerialManager          4.1.4f2
    com.apple.filesystems.autofs          3.0
    com.apple.driver.AudioAUUC          1.60
    com.apple.driver.AGPM          100.12.87
    com.apple.driver.AppleMikeyHIDDriver          122
    com.apple.driver.X86PlatformShim          1.0.0
    com.apple.driver.AppleUpstreamUserClient          3.5.10
    com.apple.driver.AppleHDA          2.3.7fc4
    com.apple.GeForce          8.1.2
    com.apple.driver.AppleMikeyDriver          2.3.7fc4
    com.apple.driver.AppleIntelHD4000Graphics          8.1.2
    com.apple.iokit.IOUserEthernet          1.0.0d1
    com.apple.driver.AppleSMCPDRC          1.0.0
    com.apple.driver.AppleSMCLMU          2.0.3d0
    com.apple.iokit.BroadcomBluetoothHCIControllerUSBTransport          4.1.4f2
    com.apple.driver.SMCMotionSensor          3.0.3d1
    com.apple.driver.AppleLPC          1.6.0
    com.apple.Dont_Steal_Mac_OS_X          7.0.0
    com.apple.driver.ApplePolicyControl          3.4.5
    com.apple.driver.AppleIntelFramebufferCapri          8.1.2
    com.apple.driver.AppleMuxControl          3.4.5
    com.apple.driver.AppleMCCSControl          1.1.11
    com.apple.driver.AppleUSBTCButtons          237.1
    com.apple.driver.AppleUSBTCKeyboard          237.1
    com.apple.driver.AppleIRController          320.15
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless          1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib          1.0.0d1
    com.apple.BootCache          34
    com.apple.iokit.SCSITaskUserClient          3.5.5
    com.apple.driver.XsanFilter          404
    com.apple.iokit.IOAHCIBlockStorage          2.3.1
    com.apple.driver.AppleUSBHub          5.5.5
    com.apple.driver.AirPort.Brcm4331          615.20.17
    com.apple.driver.AppleSDXC          1.4.2
    com.apple.iokit.AppleBCM5701Ethernet          3.6.1b4
    com.apple.driver.AppleFWOHCI          4.9.6
    com.apple.driver.AppleAHCIPort          2.5.2
    com.apple.driver.AppleUSBEHCI          5.5.0
    com.apple.driver.AppleUSBXHCI          5.6.0
    com.apple.driver.AppleEFINVRAM          1.7
    com.apple.driver.AppleSmartBatteryManager          161.0.0
    com.apple.driver.AppleACPIButtons          1.7
    com.apple.driver.AppleRTC          1.5
    com.apple.driver.AppleHPET          1.8
    com.apple.driver.AppleSMBIOS          1.9
    com.apple.driver.AppleACPIEC          1.7
    com.apple.driver.AppleAPIC          1.6
    com.apple.driver.AppleIntelCPUPowerManagementClient          196.0.0
    com.apple.nke.applicationfirewall          4.0.39
    com.apple.security.quarantine          2.1
    com.apple.driver.AppleIntelCPUPowerManagement          196.0.0
    com.apple.iokit.IOSerialFamily          10.0.6
    com.apple.kext.triggers          1.0
    com.apple.driver.DspFuncLib          2.3.7fc4
    com.apple.iokit.IOAudioFamily          1.8.9fc11
    com.apple.kext.OSvKernDSPLib          1.6
    com.apple.nvidia.gk100hal          8.1.2
    com.apple.NVDAResman          8.1.2
    com.apple.iokit.IOAcceleratorFamily          74.5.1
    com.apple.iokit.IOFireWireIP          2.2.5
    com.apple.driver.AppleSMBusPCI          1.0.11d0
    com.apple.driver.X86PlatformPlugin          1.0.0
    com.apple.iokit.AppleBluetoothHCIControllerUSBTransport          4.1.4f2
    com.apple.driver.IOPlatformPluginFamily          5.3.0d51
    com.apple.driver.AppleHDAController          2.3.7fc4
    com.apple.iokit.IOHDAFamily          2.3.7fc4
    com.apple.iokit.IOSurface          86.0.4
    com.apple.iokit.IOBluetoothFamily          4.1.4f2
    com.apple.driver.AppleSMC          3.1.4d2
    com.apple.driver.AppleGraphicsControl          3.4.5
    com.apple.driver.AppleBacklightExpert          1.0.4
    com.apple.iokit.IONDRVSupport          2.3.7
    com.apple.driver.AppleSMBusController          1.0.11d0
    com.apple.iokit.IOGraphicsFamily          2.3.7
    com.apple.driver.AppleUSBMultitouch          237.3
    com.apple.iokit.IOUSBHIDDriver          5.2.5
    com.apple.driver.AppleThunderboltDPInAdapter          1.8.9
    com.apple.driver.AppleThunderboltDPAdapterFamily          1.8.9
    com.apple.driver.AppleThunderboltPCIDownAdapter          1.2.6
    com.apple.driver.AppleUSBMergeNub          5.5.5
    com.apple.driver.AppleUSBComposite          5.2.5
    com.apple.iokit.IOSCSIMultimediaCommandsDevice          3.5.5
    com.apple.iokit.IOBDStorageFamily          1.7
    com.apple.iokit.IODVDStorageFamily          1.7.1
    com.apple.iokit.IOCDStorageFamily          1.7.1
    com.apple.iokit.IOAHCISerialATAPI          2.5.1
    com.apple.iokit.IOSCSIArchitectureModelFamily          3.5.5
    com.apple.driver.AppleThunderboltNHI          1.7.8
    com.apple.iokit.IOThunderboltFamily          2.4.0
    com.apple.iokit.IOUSBUserClient          5.5.5
    com.apple.iokit.IO80211Family          530.4
    com.apple.iokit.IOEthernetAVBController          1.0.2b1
    com.apple.iokit.IONetworkingFamily          3.0
    com.apple.iokit.IOFireWireFamily          4.5.5
    com.apple.iokit.IOAHCIFamily          2.3.1
    com.apple.iokit.IOUSBFamily          5.6.0
    com.apple.driver.AppleEFIRuntime          1.7
    com.apple.iokit.IOHIDFamily          1.8.1
    com.apple.iokit.IOSMBusFamily          1.1
    com.apple.security.sandbox          220.3
    com.apple.kext.AppleMatch          1.0.0d1
    com.apple.security.TMSafetyNet          7
    com.apple.driver.DiskImages          345
    com.apple.iokit.IOStorageFamily          1.8
    com.apple.driver.AppleKeyStore          28.21
    com.apple.driver.AppleACPIPlatform          1.7
    com.apple.iokit.IOPCIFamily          2.7.3
    com.apple.iokit.IOACPIFamily          1.4
    com.apple.kec.corecrypto          1.0

    The third-party system modification "LittleSnitch" may be contributing to your problem. I suggest you back up all data, then uninstall it according to the developer's instructions. Reboot and see whether there's any improvement.

  • Can anybody help me with this error message I keep getting

    When I try to export my document as a pdf I keep getting this error message...  "The document “Client Invoice_TMC copy” could not be exported as...."

    What version of Numbers?What version of Mac OS X?
    Have you tried restarting Numbers?
    Have you tried restarting your computer?
    Can you export other documents to pdf?
    Have you tried printing the docmment to pdf using the built-in print dialog?  To do this select the menu item "File > Print", then click the print button, then select the "Open in Preview" select from the PDF button in the bottom left corner:

  • Can anybody help me with this quiz problem?

    Hi everybody,
    I'm newer on Presenter, but I can tell you that I've understood very well how to use it.
    Well, I've finished my presentation on Power Point, created all quizzes and questions.
    After I record the audio, the quizzes have problems. The answers didn't appear, the button labels also.
    It's very strange because, before to record the audio, I've tested the presentation publishing on HTML5 and SWF and all quizzes were fine.
    See the image:
    I've tried many things: deleted all questions, cleared the temp files and also created new questions and nothing solved this problem.
    It occurs in a preview mode and publishing in HTML5 and SWF too.
    What's happening?
    Should I re-install Adobe Presenter 10?
    (UPDATED: I've re-installed it and the same problem happen).
    Thanks.
    Rafael Bohrer.

    Hi Rafel,
    PLease apply the following fix and check if it resolves the issue:
    1. Click on the below link to download the patch :
    Shared Files - Acrobat.com
    2. Please download the zip file and extract it.
    3. Please check the version of Presenter installed on your machine.
    4. For 32bit: Please copy the PptImgExporter.dll from 32 bit folder and paste it under “C:\ProgramFiles (x86)\Adobe\Adobe Presenter 10.0”.
    5.For 64bit: Please copy the PptImgExporter.dll from 64 bit folder and paste it under “C:\Program Files\Adobe\Adobe Presenter 10.0”.
    6. Try to publish the project now and check.
    Regards,
    Mayank

Maybe you are looking for

  • Update a table in the database from a report

    The user needs to print a report multiple times for the day but needs to knwo whether or not the data was already printed so that it is not printed again...therefore I have a y/n/all field on the report to allow the user to choose what subsets of dat

  • Strange IE ExternalInterface Bug: "Object does not support this property or method"

    We have an application on a relatively slow server (I mention the speed because it may be relevant). The app is flash 8 and uses ExternalInterface to call a javascript function in its parent page. It also used the ExternalInterface to receive a call

  • Output the record in list

    ■        Create a work area with the following fields o        EMPNO o        EMPNA o        EMPID o        EMPDA (Joining Date) o        EMPSA (Salary) ■        Initialize the EMPDA to 30/01/2008 and EMPSA to   1000 ■        Populate 10 records in a

  • No sound on the video

    I have my iPhone 6 for 6 days and when I'm video recording there's no sound is anyone have the same problem?

  • Why is it my ipad  crashes whilst a lot when ime using the apps?

    Can anyone tell me why my ipad keeps crashing, whilst on apps such as Facebook, or even when ime on safari.