APLIKASI TextField 2

Diposkan oleh A. Faozan on Saturday, 10 May 2014



 APLIKASI TextField 2


import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;

public class LoginExample extends MIDlet implements CommandListener{
  private Display display;
  private TextField userName,password;
  public Form form,Images;
  private Command login,cancel;
  private Image img, imge, img2;

  public LoginExample() {
    form = new Form("Sign in");
    userName = new TextField("LoginID:", "", 30, TextField.NUMERIC);
    password = new TextField("Password:", "", 30, TextField.PASSWORD);
    cancel = new Command("Cancel", Command.CANCEL, 2);
    login = new Command("Login", Command.OK, 2);
    try{
      img = Image.createImage("/logo.png");
      imge = Image.createImage("/front_left1_bad.png");
      img2 = Image.createImage("/Congratulations-1.png");
    }catch(Exception e){
      System.out.println(e.getMessage());
    }
  }
   public void startApp() {
    display = Display.getDisplay(this);
    try{  form.append(img);}catch(Exception e){}
    form.append(userName);
    form.append(password);
    form.addCommand(cancel);
    form.addCommand(login);
    form.setCommandListener(this);
    display.setCurrent(form);
  }

  public void pauseApp() {}

  public void destroyApp(boolean unconditional) {
    notifyDestroyed();
  }

  public void validateUser(String name, String password) {
    if (name.equals("270685") && password.equals("oman")) {
      showMsg();
    } else {
      tryAgain();
    }
  }

  public void showMsg() {
    Alert success = new Alert("Login Successfully",
    "Your Login Process is completed!",
     img2, AlertType.INFO);
    success.setImage(img2);
    userName.getString();
    password.getString();
    display.setCurrent(success, form);
  }

  public void tryAgain() {
    Alert error = new Alert("Login Incorrect"," Please  try again",
    imge, AlertType.ERROR);

    error.setTimeout(900);
    error.setImage(imge);
    userName.getString();
    password.getString();
    display.setCurrent(error, form);
  }

  public void commandAction(Command c, Displayable d) {
    String label = c.getLabel();
    System.out.println(label.toString());
    if(label.equals("Cancel")) {
      destroyApp(true);
    } else if(label.equals("Login")) {
      validateUser(userName.getString(), password.getString());
    }
  }
}


# SIMPAN DENGAN NAMA FILE LoginExample.java




Read More

APLIKASI Alert 1

Diposkan oleh A. Faozan on Thursday, 8 May 2014



 APLIKASI Alert 1


import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class SoundAlertExample extends MIDlet implements
ItemStateListener, CommandListener{
  private Display display; 
  private Form form; 
  private Command exit;
  private ChoiceGroup choice;

  public void startApp(){
  display = Display.getDisplay(this);
  choice = new ChoiceGroup("List of Sound", Choice.EXCLUSIVE);
  choice.append("Message Tone", null); 
  choice.append("Confirmation Tone", null); 
  choice.append("Warning Tone", null); 
  choice.append("Alarm Tone", null); 
  choice.append("Error Tone", null); 
  exit = new Command("Exit", Command.EXIT, 1);
  form = new Form("");
  form.append(choice);
  form.addCommand(exit);
  form.setCommandListener(this);
  form.setItemStateListener(this);
  display.setCurrent(form);
  }

  public void pauseApp(){ }

  public void destroyApp(boolean unconditional){
  notifyDestroyed();
  }

  public void commandAction(Command c, Displayable s){
  String label = c.getLabel();
  if(label.equals("Exit")){
  destroyApp(false);
  }
  }

  public void itemStateChanged(Item item){
  switch (choice.getSelectedIndex()){
  case 0:
  AlertType.INFO.playSound(display);
  break;

  case 1:
  AlertType.CONFIRMATION.playSound(display);
  break;

  case 2:
  AlertType.WARNING.playSound(display);
  break;
 
  case 3:
  AlertType.ALARM.playSound(display);
  break;

  case 4:
  AlertType.ERROR.playSound(display);
  break;
  }
  }
}



# SIMPAN DENGAN NAMA FILE SoundAlertExample.java
Read More

Memulai pemrograman java dengan sun_java_wireless_toolkit-2_5-windows

Diposkan oleh A. Faozan

Memulai pemrograman java dengan sun_java_wireless_toolkit-2_5-windows

wiereles toolkit merupakan aplikasi java SE atau java mobil yang biasa di terapkan pada mobile atau aplikasi java mobil ,, untuk memulai pemprograman setidaknya anda harus tahu tentang sorce kode java

kita bisa mulai dengan HELLO WORLD



APLIKASI HelloMidlet.java


/*
 * HelloMidlet.java
 */

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloMidlet extends MIDlet implements CommandListener {
    Display display;
    Command exitCommand = new Command("Exit", Command.EXIT, 1);
    Alert helloAlert;
           
    public HelloMidlet(){
        helloAlert = new Alert(
            "Hello MIDlet", "Oman Somantri",
            null, AlertType.INFO
        );
        helloAlert.setTimeout(Alert.FOREVER);
        helloAlert.addCommand(exitCommand);
        helloAlert.setCommandListener(this);
    }
   
    public void startApp() {
        if (display == null){
            display = Display.getDisplay(this);
        }
        display.setCurrent(helloAlert);        
    }
   
    public void pauseApp() {
    }
   
    public void destroyApp(boolean unconditional) {
    }
   
    public void commandAction(Command c, Displayable d){
        if (c == exitCommand){
            destroyApp(true);
            notifyDestroyed(); // Exit
        }
    }
}



Read More

kunci jawaban 2012-2013 Oracle Academy Java Fundamentals V1 - Student

Diposkan oleh A. Faozan on Friday, 2 May 2014

kunci jawaban 2012-2013 Oracle Academy Java Fundamentals V1 - Student
sertifikasi oracle merupakan sertifikasi yang bergengsi sama seperti cisco :) oleh karena itu untuk jurusan komputer dan jaringan banyak yang menempuh kedua ujian tersebut ..
ujian oracle merupakan ujian online dimana searang yang mengikuti sertifikasi harus mengisi beberapa kuis dan harus mengikuti exam atau final examz adalah ujian nasianal untuk oracle :)

buat anda yang sedang menempuh ujian ini jangan khawatir karena saya akan memberikan bocoran tentang soal dan jawaban ujiannya di link di bawah sob :)


ada beberapa section yang harus anda kerjain

Quiz Section 1
Quiz Section 2
Quiz Section 3
 -seson 3 (1-2)
- seson 3 (3-4)
 - seson 3 (5)
-seson 3 (6 - 8)
-seson 3 (7)
-seson 3 (9-10)
- seson 3 (11)
Quiz Section 4
Quiz Section 5
Quiz Section 6
Quiz Section 7

MIDEL EXAM.. (nb : final exam soal acak refernsi pakai yg banyakk)

final exam ... next . . .

Read More

link download heking

Popular Posts

Followers

Follow by Email

Google+ Followers

category