Aplikasi Konversi Character ke Desimal, Biner, Oktal dan ASCII

  1. Buka Netbean (kalo’ belum ada ya diinstal dulu)
  2. Klik File –> New Project –> Java ME –> Mobile Aplication –> Next>
  3. Kemudian beri nama project ,Project Location, & Project Folder lalu hilangkan tanda centang pada Create Hello MIDlet –> Next>
  4. Pilih Device Configuration dan Device Profile –> Next> –> Finish
  5. Setelah itu tambahkan MIDlet dengan klik File –> New File –> MIDP –> Visual MIDlet –> Next>
  6. Lalu beri nama midlet dan dama class midlet –> Finish
  7. Kemudian

  8. Lalu pindahkan ke Screen
  9. Kemudian tambahkan Textfield pada Form

  10. Klik properties dan ubah nama label seeprti berikut
  11. Setelah itu copy code berikut kedalam cammandAction for Displayable

String str = textField.getString();

char[] chars = str.toCharArray();

StringBuffer hex = new StringBuffer();
int x = chars.length;

for(int i = 0; i < x; i++){
hex.append(Integer.toHexString((int)chars[i]));
textField2.setString(Integer.toHexString((int) chars[i]));

textField1.setString(Integer.toOctalString((int)chars[j]));

textField3.setString(Integer.toBinaryString((int)chars[k]));

textField4.setString(Integer.toString((int)chars[i]));

}

aplikasinya dapat download di sini

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s