Java ME Program to take input and Program to display marquee text > Java ME Program

Java ME Program to take input and Program to display marquee text > Java ME Program

Mobile Communication and Computing

Program 1: Midlet to take input into the device.


import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class Midlet1 extends MIDlet {

    Display d;
    TextBox tb;

    public void startApp() {
        
        d = Display.getDisplay(this);
        tb = new TextBox("NAME","",15,TextField.ANY);
        
        d.setCurrent(tb);
                
                
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
}

OUTPUT:



Program 2: Midlet to display Marquee Text 


import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class Midlet2 extends MIDlet {
    
    Display d;
    TextBox tb;
    Form f;
    Ticker t;

    public void startApp() {
        
        d = Display.getDisplay(this);
        f= new Form("MyForm");
        t = new Ticker("Welcome to Java for PhoneBoxes");
        f.setTicker(t);
        d.setCurrent(f);
        
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
}

OUTPUT:





Comments

Popular posts from this blog

Intermediate Code Generation > C Program