Results 1 to 3 of 3

Thread: ช่วยแนะหน่อยครับเขียน J2me

  1. #1
    japil
    Guest


    ช่วยแนะหน่อยครับเขียน J2me

    แสดงเลานับถอยหลังไม่ได้ช่วยหน่อยครับ
    จาก public Stirng t = "1:00" ต้องเขียนโค้ดไงครับ หรือ
    มีวิธีอื่นไหมครับ

  2. #2
    Junior Member
    Join Date
    Oct 2004
    Location
    Thailand
    Posts
    9


    Re: ช่วยแนะหน่อยครับเขียน J2me

    เคยเขียนโปรแกรมแบบนี้มาแล้วคับ :P แต่ไม่ขอเอา code ให้ดูนะคับ เพราะไม่ใช่แบบ j2me (ผมเขียน j2me ไม่เปน T_T)

    แต่วิธีการเขียนโปรแกรมก็คงมีแนวทางเดียวกันมั้งคับ

    public Stirng t = "1:00"

    เป็นผม ผมจะ ไม่เก็บเป็น String นะคับ
    ผมจะแยกเก็บเป็น int hour,minute,second

    อาจจะเริ่ม ต้น ค่า hour = 1 minute = 0 second = 0 ไว้ก่อน

    ตัว code ก็ประมาณว่า

    [code]

    while((hour!=0)&&(minute!=0)&&(second!=0))

    {



    Thread.sleep(1000);

    second--;



    พิมพ์ ( hour : minute : second );



    if(second==0)

    {


  3. #3
    Senior Member
    Join Date
    Jul 2004
    Location
    Bangkok
    Posts
    187


    Re: ช่วยแนะหน่อยครับเขียน J2me

    [code]

    int time = ...;

    int min = time%60;

    int sec = (time/60)%60;

    int hr

Similar Threads

  1. Replies: 5
    Last Post: 14-10-2007, 09:43 PM
  2. J2ME in a Nutshell
    By chaochao in forum Java
    Replies: 0
    Last Post: 23-09-2007, 08:13 PM
  3. J2ME กับภาษาไทย
    By Anonymous in forum Symbian C++, J2ME, Brew,XHTML
    Replies: 3
    Last Post: 25-01-2005, 11:05 AM
  4. Replies: 0
    Last Post: 16-03-2004, 11:47 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •