Pada project ini mengenai pesawat, yang terdiri atas dua file yaitu :
= MainCanvas.java =
/**
author@adhi cahyaningrat
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class gaya extends JFrame{
private JFrame f = new JFrame("DATABASE PERHITUNGAN GAYA (KELOMPOK 1)");
private JLabel jLabel1 = new JLabel("Adhy Cahyaningrat"),
jLabel2 = new JLabel("Pizaini"),
jLabel3 = new JLabel("Jelly"),
jLabel4 = new JLabel("Heru Wibowo"),
jLabel5 = new JLabel("Rivai Frolan");
private JMenuBar jMenuBar1 = new javax.swing.JMenuBar();
private JMenu jMenu1 = new javax.swing.JMenu();
private JMenuItem jMenuItem3 = new javax.swing.JMenuItem();
private JButton jButton1 = new JButton(" Data ");
private JPanel jPanel1 = new JPanel();
public gaya(){
f.getContentPane().setLayout(null);
jButton1.setBounds(150,150,250,20);
f.getContentPane().add(jButton1);
jLabel1.setBounds(220,25,200,20);
f.getContentPane().add(jLabel1);
jLabel2.setBounds(230,40,200,20);
f.getContentPane().add(jLabel2);
jLabel3.setBounds(240,55,200,20);
f.getContentPane().add(jLabel3);
jLabel4.setBounds(250,70,200,20);
f.getContentPane().add(jLabel4);
jLabel5.setBounds(260,85,200,20);
f.getContentPane().add(jLabel5);
jButton1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
new bahan();
}
});
f.setSize(600,350);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
}
public static void main(String args[]){
new gaya();
}
}
= Pesawat.java =
/**
@author adhi cahyaningrat
*/
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class Pesawat extends MIDlet{
private Display display;
private MainCanvas mainCanvas;
public Pesawat(){
display = Display.getDisplay(this);
}
public void startApp(){
mainCanvas = new MainCanvas(this, display);
display.setCurrent(mainCanvas);
new Thread(mainCanvas).start();
}
public void pauseApp(){
}
public void destroyApp(boolean unconditional){
}
public void exitMIDlet(){
destroyApp(false);
notifyDestroyed();
}
}
Tidak ada komentar:
Posting Komentar