Each section blow gives a code chunk that shows a different type of Alert in a J2ME app.
AlertType Alarm
This type of Alert shows an alarm typically based on a pre-defined time when user needs to be reminded of something. If your program is reminding the user of some time based event, this is the alert to use. The code used for this type of alert is :
Alert a = new Alert("This is the alert");
a.setTitle("Alert");
a.setType(AlertType.ALARM);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
a.setTitle("Alert");
a.setType(AlertType.ALARM);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
And the output will look something like:
AlertType CONFIRMATION
This type of alert is used to confirm something from the user. If you are inquiring or questionging the user in a message, this is the AlertType to be used.
Here's the code to show such an Alert:
Alert a = new Alert("This is the alert");
a.setTitle("Alert");
a.setType(AlertType.CONFIRMATION);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
The output of the code will be similar to the image below:
AlertType ERROR
When you want to communicate about an error that has occured in a J2ME program, use AlertType.ERROR in your code. Here's the code sample:
Alert a = new Alert("This is the alert");
a.setTitle("Alert");
a.setType(AlertType.ERROR);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
a.setTitle("Alert");
a.setType(AlertType.ERROR);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
The output of the above code is shown in the screenshot below:
AlertType INFO
An error that gives some general information to the user, you should use INFO type alert. This can be done by using AlertType.INFO when instantiating the Alert object in your code. Following code is used to show an INFO type alert:
Alert a = new Alert("This is the alert");
a.setTitle("Alert");
a.setType(AlertType.INFO);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
a.setTitle("Alert");
a.setType(AlertType.INFO);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
And here is the output screenshot of the output of the above code.
AlertType Alarm
As the name suggests, this kind of Alert is used to give warnings to the user in a J2ME app. Use following code for giving such warnings:
Alert a = new Alert("This is the alert");
a.setTitle("Alert");
a.setType(AlertType.WARNING);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
a.setTitle("Alert");
a.setType(AlertType.WARNING);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
The output of the above code is given below:
Please note that above alert types are given standard alert types defined in J2ME. Any phones supporting J2ME MIDP should have these alerts available on device. The type of icon, size, shape and color of the icons on the Alert may be different depending on the implementation of the J2ME alerts on that device, but the basic reason of showing the alerts and the type of icons shown on all devices will give out the same message to the user.
Related J2ME articles:
- J2ME Alert - Code example
- J2ME Alert - Code example - Displaying images in Alert
- J2ME Form - Code example
- J2ME Canvas - Code example
I am happy for sharing on this blog its awesome blog I really impressed. thanks for sharing.
ReplyDeleteSoftgen Infotech is the Best SAP HANA Admin Training in Bangalore located in BTM Layout, Bangalore providing quality training with Realtime Trainers and 100% Job Assistance.
no deposit bonus forex 2021 - takipçi satın al - takipçi satın al - takipçi satın al - takipcialdim.com/tiktok-takipci-satin-al/ - instagram beğeni satın al - instagram beğeni satın al - google haritalara yer ekleme - btcturk - tiktok izlenme satın al - sms onay - youtube izlenme satın al - google haritalara yer ekleme - no deposit bonus forex 2021 - tiktok jeton hilesi - tiktok beğeni satın al - binance - takipçi satın al - uc satın al - finanspedia.com - sms onay - sms onay - tiktok takipçi satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - tiktok takipçi satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - perde modelleri - instagram takipçi satın al - instagram takipçi satın al - cami avizesi - marsbahis
ReplyDeleteperde modelleri
ReplyDeletesms onay
Vodafone Mobil Ödeme Bozdurma
nft nasil alınır
Ankara evden eve nakliyat
Trafik sigortası
Dedektor
web sitesi kurma
Aşk romanları
SMM PANEL
ReplyDeleteSmm panel
iş ilanları
İnstagram Takipçi Satın Al
hirdavatciburada.com
beyazesyateknikservisi.com.tr
servis
JETON HİLESİ İNDİR