-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormDesign.java
More file actions
65 lines (48 loc) · 1.72 KB
/
FormDesign.java
File metadata and controls
65 lines (48 loc) · 1.72 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
57
58
59
60
61
62
63
64
65
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class FormDesign extends MIDlet implements CommandListener
{
public Form form =new Form("Sign In Here");
public TextField t1 =new TextField("Username","",10,TextField.ANY);
public TextField t2 =new TextField("Password","",10,TextField.PASSWORD);
//public TextField t3 =new TextField("lang","",10,TextField.CHAR);
public Command SignIn=new Command("SignIn",Command.OK,1);
public ChoiceGroup c1;
public ChoiceGroup rbtn;
private int defaultindex, rbtnindex;
public FormDesign()
{
c1 =new ChoiceGroup("Languages Known",Choice.MULTIPLE);
c1.append("English", null);
c1.append("Hindi", null);
c1.append("Gujarati", null);
c1.append("Other", null);
rbtn = new ChoiceGroup("Select Your Gender",Choice.EXCLUSIVE);
rbtn.append("Male",null);
rbtn.append("Female",null);
rbtn.append("All", null);
rbtn.setSelectedIndex(defaultindex, true);
form.append(t1);
form.append(t2);
form.addCommand(SignIn);
form.setCommandListener(this);
form.append(c1);
//form.append(t3);
rbtnindex = form.append(rbtn);
}
public void commandAction(Command c, Displayable d) {
if(c==SignIn)
{
Alert a1 = new Alert("LOGGED IN","You have successfully" + " logged in",null,AlertType.INFO);
a1.setTimeout(30000);
Display.getDisplay(this).setCurrent(a1,form);
}
}
public void startApp() {
Display.getDisplay(this).setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}