Created
May 4, 2016 21:38
-
-
Save andrelramos/17af02363706a0fb97f65aaadaa22375 to your computer and use it in GitHub Desktop.
Hour exemple in J2ME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.microedition.midlet.*; | |
import javax.microedition.lcdui.*; | |
import java.util.*; | |
public class Main extends MIDlet { | |
private Display display; | |
private Form frmHour; | |
private StringItem hour; | |
public Main(){} | |
protected void startApp() { | |
if(display == null) { | |
display = Display.getDisplay(this); | |
} | |
Calendar c = Calendar.getInstance(); | |
String time = c.get(Calendar.HOUR_OF_DAY) + ":" +c.get(Calendar.MINUTE) | |
+ ":" + c.get(Calendar.SECOND); | |
frmHour = new Form("Form Hour"); | |
hour = new StringItem("Hour: ", time); | |
frmHour.append(hour); | |
display.setCurrent(frmHour); | |
} | |
protected void pauseApp() {} | |
protected void destroyApp(boolean force) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment