-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormNav.java
More file actions
56 lines (43 loc) · 1.3 KB
/
Copy pathFormNav.java
File metadata and controls
56 lines (43 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class FormNav extends MIDlet implements CommandListener
{
private Form form1 =new Form("Enter Details");
//private Form form2;// =new Form("Your Details are");
public static TextField t1 =new TextField("Your Name","",10,TextField.ANY);
public static TextField t2 =new TextField("Roll No.","",10,TextField.DECIMAL);
private Command Ok =new Command("Submit",Command.OK,1);
//private Form2 f2;
public String s1;
public String s2;
public FormNav()
{
form1.append(t1);
form1.append(t2);
form1.addCommand(Ok);
form1.setCommandListener(this);
Display.getDisplay(this).setCurrent(form1);
}
public void commandAction(Command c,Displayable d)
{
if(c==Ok)
{
Form form2 =new Form("Your Details are");
Display.getDisplay(this).setCurrent(form2);
s1=t1.getString();
s2=t2.getString();
form2.append("Your Name is "+s1);
form2.append("\nYour Roll No. is "+s2);
}
}
public void startApp()
{
//Display.getDisplay(this).setCurrent(form1);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
}