Anda di halaman 1dari 25

PENG EMBA NG A N A PLIKA SI MO BILE

MODULPRAKTIKUM

HighLevelUserInterface
Versi1.0

JA VA EDUC A T IO N NET W O RK INDO NESIA

Modul Praktikum High Level User Interface

1.

T ujua n
Menget ahui keunt ungan dan kerugian dengan m enggunakan high- level dan low- level UI classes Menget ahui desain MI Dlet s m enggunakan kom ponen high- level UI Mengident ifikasi perbedaan sub- classes pada screen Menget ahui perbedaan it em - it em yang dapat dim asukkan kedalam sebuah obj ect Form

2.

La ta r Be la ka ng
MDI P user int erface didesain unt uk peralat an m obile. Aplikasi MDI P dit unj ukan pada area lim it ed screen. Peralat an m em ory j uga m enj adi fakt or pent ing j ika perlengkapan m obile hanya m em iliki kapasit as m em ory yang kecil Dengan berbagai m acam peralat an m obile, dari berbagai m odel m obile phones sam pai PDAs, MI DP user int erface t elah didesain unt uk lebih fleksibel dan m udah digunakan dalam berbagai m acam peralat an ini. MI DP m em punyai class yang dapat m enangani fungsi high- level dan low- level user int erface. High- level UI int erfaces didesain secara fleksibel. Penam pilan dari kom ponen ini t idak didefinisikan secara spesifik. Penam pilan screen yang sebenarnya dari berbagai m acam kom ponen ini digunakan dari sat u peralat an ke peralat an yang lain. Tet api para program m er t elah t eryakinkan oleh kegunaan dari high- level kom ponen UI int erfaces m em iliki persam aan dalam berbagai spesifikasi- pengim plem ent asi secara keseluruhan.

3.

Pe rc o b a a n

Pe rc o b a a n 1:Pe ng g una a n Ale rt


imp o rt ja va x.mic ro e d itio n.m id le t.*; im p o rt ja va x.m ic ro e d itio n.lc d ui.*; p ub lic c la ss Ale rtExa mp le e xte nd s MIDle t imp le me nts C o m ma nd Liste ne r { Disp la y d isp la y; Fo rm ma inFo rm ; C o mm a nd e xitC o mm a nd = ne w C o mma nd ("Exit", C o mma nd .EXIT , 0); C o mm a nd o kC o mm a nd = ne w C o mma nd ("O k", C o mma nd .O K, 0); G a ug e g a ug e = ne w G a ug e (null, fa lse , 5, 0);

Ve rsi 1.0

1 | Pa g e

Modul Praktikum High Level User Interface


C o mm a nd [] c o m m a nd s = { ne w C o mma nd ("Ala rm ", C o mm a nd .O K, 0), ne w C o mma nd ("C o nfirma tio n", C o mma nd .O K, 0), ne w C o mma nd ("Info ", C o mma nd .O K, 0), ne w C o mma nd ("Wa rning ", C o mma nd .O K, 0), ne w C o mma nd ("Erro r", C o mma nd .O K, 0), ne w C o mma nd ("Mo d a l", C o mma nd .O K, 0) }; Ale rt[] a le rts = { ne w Ale rt("Ala rm Ale rt", "Exa mp le o f a n Ala rm typ e o f Ale rt", null, Ale rtT yp e .ALARM), ne w Ale rt("C o nfirma tio n Ale rt", "Exa mp le o f a n C O NFIRMAT IO N typ e o f Ale rt", null, Ale rtT yp e .C O NFIRMAT IO N), ne w Ale rt("Info Ale rt", "Exa mp le o f a n INFO typ e o f Ale rt", null, Ale rtT yp e .INFO ), ne w Ale rt("Wa rning Ale rt", "Exa mp le o f a n WARNING typ e o f Ale rt, w/ g a ug e ind ic a to r", null, Ale rtT yp e .WARNING ), ne w Ale rt("Erro r Ale rt", "Exa mp le o f a n ERRO R typ e o f Ale rt, w/ a n 'O K' C o mma nd ", null, Ale rtT yp e .ERRO R), ne w Ale rt("Mo d a l Ale rt", "Exa mp le o f a n mo d a l Ale rt: time o ut = FO REVER",

Ve rsi 1.0

2 | Pa g e

Modul Praktikum High Level User Interface


null, Ale rtT yp e .ERRO R), }; p ub lic Ale rtExa mp le (){ ma inFo rm = ne w Fo rm ("JEDI: Ale rt Exa mp le "); m a inFo rm .a d d C o m ma nd (e xitC o mma nd ); fo r (int i=0; i< c o mma nd s.le ng th; i++){ ma inFo rm.a d d C o mma nd (c o mma nd s[i]); } ma inFo rm.se tC o mma nd Liste ne r(this); / / Me na mb a h se b ua h g a ug e d a n me ng e -se t time o ut (m illise c o nd s) a le rts[3].se tInd ic a to r(g a ug e ); a le rts[3].se tT im e o ut(5000); / / Me na mb a h se b ua h c o mma nd untuk Ale rt a le rts[4].a d d C o mma nd (o kC o mma nd ); / / Me ng e -Se t a le rt a le rts[5].se tT im e o ut(Ale rt.FO REVER); } p ub lic vo id sta rtAp p () { if (d isp la y == null){ d isp la y = Disp la y.g e tDisp la y(this); d isp la y.se tC urre nt(m a inFo rm); } } p ub lic vo id p a use Ap p () {} p ub lic vo id d e stro yAp p (b o o le a n unc o nd itio na l) {} p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Disp la ya b le d ){

Ve rsi 1.0

3 | Pa g e

Modul Praktikum High Level User Interface


if (c == e xitC o mma nd ){ d e stro yAp p (true ); no tifyDe stro ye d (); / / Exit } fo r (int i=0; i<c o mma nd s.le ng th; i++){ if (c == c o m m a nd s[i]){ d isp la y.se tC urre nt(a le rts[i]); } } } }

Ha sil :

Ve rsi 1.0

4 | Pa g e

Modul Praktikum High Level User Interface


Pe rc o b a a n 2: Pe ng g una a n List
imp o rt ja va x.mic ro e d itio n.m id le t.*; im p o rt ja va x.m ic ro e d itio n.lc d ui.*; p ub lic c la ss ListExa m p le e xte nd s MIDle t im p le me nts C o mm a nd Liste ne r { Disp la y d isp la y; List list; C o mm a nd e xitC o mm a nd = ne w C o mma nd ("Exit", C o mma nd .EXIT , 1); C o mma nd ne wC o mma nd = ne w C o mma nd ("Ne w Ite m", C o mma nd .O K, 1); C o mm a nd re na me C o mm a nd = ne w C o mm a nd ("Re na m e Ite m ", C o m ma nd .O K, 1); C o mma nd d e le te C o mma nd = ne w C o mma nd ("De le te Ite m ", C o mma nd .O K, 1); T ic ke r tic ke r = ne w T ic ke r( "JENI- Ja va Ed uc a tio n Ne two rk Ind o ne sia ");

p ub lic ListExa m p le (){ list = ne w List("JENI : C o nto h List", List.IMPLIC IT ); list.a p p e nd ("List Ite m # 1", null); list.a p p e nd ("List Ite m # 2", null); list.a p p e nd ("List Ite m # 3", null); list.se tT ic ke r(tic ke r); list.a d d C o mma nd (e xitC o mma nd ); list.a d d C o mma nd (ne wC o mma nd ); list.a d d C o mma nd (re na m e C o mma nd ); list.a d d C o mma nd (d e le te C o m ma nd ); list.se tC o m ma nd Liste ne r(this); }

Ve rsi 1.0

5 | Pa g e

Modul Praktikum High Level User Interface


p ub lic vo id sta rtAp p () { if (d isp la y == null){ d isp la y = Disp la y.g e tDisp la y(this); d isp la y.se tC urre nt(list); } }

p ub lic vo id p a use Ap p () { }

p ub lic vo id d e stro yAp p (b o o le a n unc o nd itio na l) { }

p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Disp la ya b le d ){ if (c == e xitC o mma nd ){ d e stro yAp p (true ); no tifyDe stro ye d (); / / Exit } if (c == List.SELEC T _C O MMAND){ int ind e x = list.g e tSe le c te d Ind e x(); String c urre ntIte m = list.g e tString (ind e x); / / me nja la nka n sua tu ha l } } }

Ve rsi 1.0

6 | Pa g e

Modul Praktikum High Level User Interface


Ha sil :

Pe rc o b a a n 3: C ho ic e G ro up
imp o rt ja va x.mic ro e d itio n.m id le t.*; im p o rt ja va x.m ic ro e d itio n.lc d ui.*; p ub lic c la ss C ho ic e Exa m p le e xte nd s MIDle t imp le me nts C o mma nd Liste ne r { Disp la y d isp la y; Fo rm c ho ic e Fo rm ; C o mm a nd e xitC o mm a nd = ne w C o mma nd ("Exit", C o mma nd .EXIT , 1); C ho ic e G ro up c ho ic e Exc lusive ,c ho ic e Multip le ,c ho ic e Po p up ;

p ub lic C ho ic e Exa mp le (){ c ho ic e Fo rm = ne w Fo rm ("C ho ic e G ro up T yp e s"); c ho ic e Fo rm .a d d C o mma nd (e xitC o mma nd );

Ve rsi 1.0

7 | Pa g e

Modul Praktikum High Level User Interface


c ho ic e Fo rm .se tC o mma nd Liste ne r(this); c ho ic e Exc lusive = ne w C ho ic e G ro up ("Exc lusive ", C ho ic e .EXC LUSIVE); c ho ic e Exc lusive .a p p e nd ("Ma le ", null); c ho ic e Exc lusive .a p p e nd ("Fe ma le ", null); c ho ic e Fo rm .a p p e nd (c ho ic e Exc lusive );

c ho ic e Multip le = ne w C ho ic e G ro up ("Multip le ", C ho ic e .MULT IPLE); c ho ic e Multip le .a p p e nd ("Ap p le ", null); c ho ic e Multip le .a p p e nd ("O ra ng e ", null); c ho ic e Multip le .a p p e nd ("G ra p e s", null); c ho ic e Fo rm .a p p e nd (c ho ic e Multip le );

c ho ic e Po p up = ne w C ho ic e G ro up ("Po p up ", C ho ic e .PO PUP); c ho ic e Po p up .a p p e nd ("Asia ", null); c ho ic e Po p up .a p p e nd ("Euro p e ", null); c ho ic e Po p up .a p p e nd ("Ame ric a s", null); c ho ic e Fo rm .a p p e nd (c ho ic e Po p up ); }

p ub lic vo id sta rtAp p () { if (d isp la y == null){ d isp la y = Disp la y.g e tDisp la y(this); d isp la y.se tC urre nt(c ho ic e Fo rm); } }

Ve rsi 1.0

8 | Pa g e

Modul Praktikum High Level User Interface


p ub lic vo id p a use Ap p () { }

p ub lic vo id d e stro yAp p (b o o le a n unc o nd itio na l) { }

p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Disp la ya b le d ){ if (c == e xitC o mma nd ){ d e stro yAp p (true ); no tifyDe stro ye d (); / / Exit } } }

Ha sil :

Ve rsi 1.0

9 | Pa g e

Modul Praktikum High Level User Interface


Pe rc o b a a n 4: Da te Fie ld
imp o rt ja va x.mic ro e d itio n.m id le t.*; im p o rt ja va x.m ic ro e d itio n.lc d ui.*; p ub lic c la ss Da te Fie ld Exa mp le e xte nd s MIDle t im p le me nts C o mm a nd Liste ne r { Disp la y d isp la y; Fo rm d a te Fo rm ; C o mm a nd e xitC o mm a nd = ne w C o mma nd ("Exit", C o mma nd .EXIT , 1); Da te Fie ld d a te o nly,tim e o nly,d a te time ;

p ub lic Da te Fie ld Exa mp le (){ d a te Fo rm = ne w Fo rm ("Da te Fie ld Mo d e s"); d a te Fo rm.a d d C o mma nd (e xitC o mma nd ); d a te Fo rm .se tC o m m a nd Liste ne r(this); Da te Fie ld d a te o nly = ne w Da te Fie ld ("Birthd a y (DAT E)", Da te Fie ld .DAT E); Da te Fie ld tim e o nly = ne w Da te Fie ld ("Se t Ala rm (T IME)", Da te Fie ld .T IME); Da te Fie ld d a te time = ne w Da te Fie ld ("De p a rture (DAT E_T IME)", Da te Fie ld .DAT E_T IME); d a te Fo rm .a p p e nd (d a te o nly); d a te Fo rm .a p p e nd (tim e o nly); d a te Fo rm .a p p e nd (d a te time ); }

p ub lic vo id sta rtAp p () { if (d isp la y == null){

Ve rsi 1.0

10 | P a g e

Modul Praktikum High Level User Interface


d isp la y = Disp la y.g e tDisp la y(this); d isp la y.se tC urre nt(d a te Fo rm); } }

p ub lic vo id p a use Ap p () { }

p ub lic vo id d e stro yAp p (b o o le a n unc o nd itio na l) { }

p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Disp la ya b le d ){ if (c == e xitC o mma nd ){ d e stro yAp p (true ); no tifyDe stro ye d (); / / Exit } } }

Ve rsi 1.0

11 | P a g e

Modul Praktikum High Level User Interface


Ha sil :

Pe rc o b a a n 5: Pe ng g una a n String Ite m


imp o rt ja va x.mic ro e d itio n.m id le t.*; im p o rt ja va x.m ic ro e d itio n.lc d ui.*; p ub lic c la ss String Exa m p le e xte nd s MIDle t im p le m e nts C o mm a nd Liste ne r,Ite mC o mm a nd Liste ne r { Disp la y d isp la y; Fo rm string Fo rm ; C o mm a nd e xitC o mm a nd = ne w C o mma nd ("Exit", C o mma nd .EXIT , 1); Da te Fie ld d a te o nly,tim e o nly,d a te time ;

p ub lic String Exa mp le (){ string Fo rm = ne w Fo rm ("String Fie ld Mo d e s"); string Fo rm .a d d C o m ma nd (e xitC o mma nd ); string Fo rm.se tC o mma nd Liste ne r(this);

Ve rsi 1.0

12 | P a g e

Modul Praktikum High Level User Interface


String Ite m p la in = ne w String Ite m ("Pla in", "Pla in T e xt", Ite m .PLAIN); String Ite m hyp e rlink = ne w String Ite m("Hyp e rlink", "http :/ / www.sun.c o m", Ite m .HYPERLINK); hyp e rlink.se tDe fa ultC o mma nd (ne w C o mm a nd ("Se t", C o mma nd .IT EM, 0)); hyp e rlink.se tIte mC o mma nd Liste ne r(this); String Ite m b utto n = ne w String Ite m ("Butto n", "C lic k me ", Ite m .BUT T O N); b utto n.se tDe fa ultC o mma nd (ne w C o mma nd ("Se t", C o mma nd .IT EM, 0)); b utto n.se tIte mC o mma nd Liste ne r(this); string Fo rm.a p p e nd (p la in); string Fo rm.a p p e nd (hyp e rlink); string Fo rm.a p p e nd (b utto n); }

p ub lic vo id sta rtAp p () { if (d isp la y == null){ d isp la y = Disp la y.g e tDisp la y(this); d isp la y.se tC urre nt(string Fo rm); } }

p ub lic vo id p a use Ap p () { }

p ub lic vo id d e stro yAp p (b o o le a n unc o nd itio na l) { }

Ve rsi 1.0

13 | P a g e

Modul Praktikum High Level User Interface


p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Disp la ya b le d ){ if (c == e xitC o mma nd ){ d e stro yAp p (true ); no tifyDe stro ye d (); / / Exit } } p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Ite m ite m){ if(ite m .g e tLa b e l().e q ua ls("Butto n")){ / / ke rja ka n Se sua tu } if(ite m .g e tLa b e l().e q ua ls("Hyp e rlink")){ / / ke rja ka n Se sua tu } } }

Ve rsi 1.0

14 | P a g e

Modul Praktikum High Level User Interface


Ha sil :

Pe rc o b a a n 6: Pe ng g una a n Ima g e
imp o rt ja va x.mic ro e d itio n.m id le t.*; im p o rt ja va x.m ic ro e d itio n.lc d ui.*; p ub lic c la ss Im a g e Exa mp le e xte nd s MIDle t im p le m e nts C o mm a nd Liste ne r { Disp la y d isp la y; Fo rm ima g e Fo rm ; C o mm a nd e xitC o mm a nd = ne w C o mma nd ("Exit", C o mma nd .EXIT , 1); Da te Fie ld d a te o nly,tim e o nly,d a te time ; T ic ke r tic ke r = ne w T ic ke r( "JENI - Ja va Ed uc a tio n Ne two rk Ind o ne sia ");

p ub lic Im a g e Exa m p le (){

Ve rsi 1.0

15 | P a g e

Modul Praktikum High Level User Interface


ima g e Fo rm = ne w Fo rm ("Ima g e Ite m"); ima g e Fo rm.a d d C o mma nd (e xitC o mma nd ); im a g e Fo rm.se tC o mma nd Liste ne r(this); ima g e Fo rm.se tT ic ke r(tic ke r); try { Ima g e im g = Ima g e .c re a te Ima g e ("/ JENI.p ng "); Ima g e Ite m ima g e = ne w Ima g e Ite m ("JENI", im g , Ite m .LAYO UT _C ENT ER, "je ni lo g o "); im a g e Fo rm .a p p e nd (im a g e ); } c a tc h (Exc e p tio n e ){e .p rintSta c kT ra c e ();} }

p ub lic vo id sta rtAp p () { if (d isp la y == null){ d isp la y = Disp la y.g e tDisp la y(this); d isp la y.se tC urre nt(ima g e Fo rm); } }

p ub lic vo id p a use Ap p () { }

p ub lic vo id d e stro yAp p (b o o le a n unc o nd itio na l) { }

p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Disp la ya b le d ){

Ve rsi 1.0

16 | P a g e

Modul Praktikum High Level User Interface


if (c == e xitC o mma nd ){ d e stro yAp p (true ); no tifyDe stro ye d (); / / Exit } } }

Ha sil :

Ve rsi 1.0

17 | P a g e

Modul Praktikum High Level User Interface


Pe rc o b a a n 7: Pe ng g una a n T e xtFie ld
imp o rt ja va x.mic ro e d itio n.m id le t.*; im p o rt ja va x.m ic ro e d itio n.lc d ui.*; p ub lic c la ss T e xtFie ld Exa mp le e xte nd s MIDle t imp le me nts C o mma nd Liste ne r { Disp la y d isp la y; Fo rm te xtFo rm ; C o mm a nd e xitC o mm a nd = ne w C o mma nd ("Exit", C o mma nd .EXIT , 1); Da te Fie ld d a te o nly,tim e o nly,d a te time ; T ic ke r tic ke r = ne w T ic ke r( "JENI - Ja va Ed uc a tio n Ne two rk Ind o ne sia "); p ub lic T e xtFie ld Exa mp le (){ te xtFo rm = ne w Fo rm ("T e xtFie ld T yp e s"); te xtFo rm.a d d C o mma nd (e xitC o mma nd ); te xtFo rm .se tC o mm a nd Liste ne r(this); T e xtFie ld ANY = ne w T e xtFie ld ("ANY", "", 64, T e xtFie ld .ANY); T e xtFie ld EMAILADDR = ne w T e xtFie ld ("EMAILADDR", "", 64, T e xtFie ld .EMAILADDR); T e xtFie ld NUMERIC = ne w T e xtFie ld ("NUMERIC ", "", 64, T e xtFie ld .NUMERIC ); T e xtFie ld PHO NENUMBER = ne w T e xtFie ld ("PHO NENUMBER", "", 64, T e xtFie ld .PHO NENUMBER); T e xtFie ld URL = ne w T e xtFie ld ("URL", "", 64, T e xtFie ld .URL); T e xtFie ld DEC IMAL = ne w T e xtFie ld ("DEC IMAL", "", 64, T e xtFie ld .DEC IMAL); te xtFo rm .a p p e nd (ANY);

Ve rsi 1.0

18 | P a g e

Modul Praktikum High Level User Interface


te xtFo rm.a p p e nd (EMAILADDR); te xtFo rm .a p p e nd (NUMERIC ); te xtFo rm.a p p e nd (PHO NENUMBER); te xtFo rm.a p p e nd (URL); te xtFo rm .a p p e nd (DEC IMAL); te xtFo rm.se tT ic ke r(tic ke r); } p ub lic vo id sta rtAp p () { if (d isp la y == null){ d isp la y = Disp la y.g e tDisp la y(this); d isp la y.se tC urre nt(te xtFo rm); } } p ub lic vo id p a use Ap p () { } p ub lic vo id d e stro yAp p (b o o le a n unc o nd itio na l) { } p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Disp la ya b le d ){ if (c == e xitC o mma nd ){ d e stro yAp p (true ); no tifyDe stro ye d (); / / Exit } } }

Ve rsi 1.0

19 | P a g e

Modul Praktikum High Level User Interface


Ha sil :

4.

La tiha n
Buat lah sebuah MI Dlet yang m em iliki List I MPLI CI T sebagai Screen m ain. Masukan t iga Com m and kedalam List ini - Add I t em , Rem ove I t em dan Exit . Com m an Add I t em akan m em berikan layanan pada user unt uk m em asukan list m enggunakan Text Box, kem udian insert it em t ersebut sebelum current it em yang dipilih dari list . Rem ove I t em akan m enghapus current ly select ed list it em ( get Select edI ndex) . Com m and Exit akankeluar dari program .

3.12.1 List Dinamis

Ve rsi 1.0

20 | P a g e

Modul Praktikum High Level User Interface


Hasil Out put :

Ve rsi 1.0

21 | P a g e

Modul Praktikum High Level User Interface


Jawaban:
imp o rt ja va x.mic ro e d itio n.m id le t.*; im p o rt ja va x.m ic ro e d itio n.lc d ui.*;

p ub lic c la ss Dyna mic List e xte nd s MIDle t imp le me nts C o mma nd Liste ne r { Disp la y d isp la y; List list; T e xtBo x te xtb o x; C o mma nd e xitC o mma nd = ne w C o mm a nd ("Exit", C o mma nd .EXIT , 1); C o mma nd a d d C o mma nd = ne w C o mm a nd ("Ad d Ite m", C o mma nd .O K, 1); C o mma nd re mo ve C o mma nd = ne w C o mma nd ("Re mo ve Ite m ", C o mma nd .O K, 1);

C o mma nd o kC o mma nd = ne w C o mm a nd ("O K", C o mma nd .O K, 1); C o mma nd c a nc e lC o mma nd = ne w C o mm a nd ("C a nc e l", C o mma nd .EXIT , 1);

p ub lic Dyna mic List(){ list = ne w List("JEDI: Dyna mic List", List.IMPLIC IT ); list.a d d C o mma nd (e xitC o mma nd ); list.a d d C o mma nd (a d d C o mma nd ); list.a d d C o mma nd (re mo ve C o mma nd ); list.se tC o mma nd Liste ne r(this);

te xtb o x = ne w T e xtBo x("Ad d List Ite m", "", 64, T e xtFie ld .ANY); te xtb o x.a d d C o mma nd (o kC o mma nd );

Ve rsi 1.0

22 | P a g e

Modul Praktikum High Level User Interface


te xtb o x.a d d C o mma nd (c a nc e lC o mma nd ); te xtb o x.se tC o mma nd Liste ne r(this); } p ub lic vo id sta rtAp p () { if (d isp la y == null){ d isp la y = Disp la y.g e tDisp la y(this); d isp la y.se tC urre nt(list); } } p ub lic vo id p a use Ap p () { } p ub lic vo id d e stro yAp p (b o o le a n unc o nd itio na l) { } p ub lic vo id c o mma nd Ac tio n(C o mma nd c , Disp la ya b le d ){ if (c == e xitC o mma nd ){ no tifyDe stro ye d (); / / Exit } if (c == a d d C o mma nd ){ te xtb o x.se tString (""); d isp la y.se tC urre nt(te xtb o x); } if (c == re mo ve C o mma nd ){ int ind e x = list.g e tSe le c te d Ind e x(); if (ind e x != -1){

Ve rsi 1.0

23 | P a g e

Modul Praktikum High Level User Interface


list.d e le te (ind e x); } e lse { / / no ite m se le c te d } } if (c == o kC o mma nd ){ int ind e x = list.g e tSe le c te d Ind e x(); if (ind e x != -1){ list.inse rt(ind e x, te xtb o x.g e tString (), null); } e lse { / / list mig ht b e e mp ty list.a p p e nd (te xtb o x.g e tString (), null); } d isp la y.se tC urre nt(list); } if (c == c a nc e lC o mma nd ){ d isp la y.se tC urre nt(list); } } }

Ve rsi 1.0

24 | P a g e