Selasa, 01 Januari 2013

{BONUS UANG} Master Java Tolong Bantu Donk :)

Gan ane lagi ada tugas,,ane langsung blak2an aja yaa ganSmilie,ane kurang bisa java ,kalaupun bisa cuma CRUD aja gan,,naah sekarang lagi di suruh buat program ,lagi ada tugas.udah mentok banget gan.maaf banget nihh bukan nya males gan..ane bener2 udah mentok.

Bagi yang bisa ane hadiah hin uang 150 deeh gan.maaf gan ane ga bisa lebiih,,karena cuma mahasiwa ganSmilie

jadi ane di suruh buat program yang langkah2 nya gini gan
1.input lokasi
2.input jumlah stok,nah pas input jumlah stok misal kita masukkin 2 ,terus kli tombol create,nah nanto muncul kaya gambar biru pertama,nama blok sama jumlah unit sebanyak 2.nanti kita isi masing blok dan jumlah nya,kalau udah kita klik create
3.nanti muncuk inputan untuk masing2 blok pake Jtable gan,,,
4.kalau udah di input semua,tinggal save.

mohon bantuan agan2 sekalianSmilie,,, ini nomor hp ane gan kalau agan emang perlu data ane 081381283808



Spoilerfor gambar1:

{BONUS UANG} Master Java Tolong Bantu Donk :) 4






Spoilerfor gambar2:

{BONUS UANG} Master Java Tolong Bantu Donk :) 5







Anak gunadarma.
Yadiet...
Ada juniormu disini minta kerjain tugas.
Stick Out Tongue

NB : Kalo agak gak pernah nyoba, kapan bisanya ?
Setidaknya usaha dulu lah....

Ane mahasiswa Poltek GanSmilie,jurusan teknologi komputer dan jaringanSmilie

saya ga bisa di generate form nya dan input pake table
tadi mau di masukkin source code nya ada tulisan kaya gini,padahal saya sudah pake spoiler

"The Message that you have entered is too long ( 21937 characters). Please shorten it to 10000 characters long."



http://ideone.com/

Upload ke link diatas aja, trus URL-nya copy kesini.
Big Grin


Quote:Original Posted By DarknessTalic â–º
http://ideone.com/

Upload ke link diatas aja, trus URL-nya copy kesini.
Big Grin


maaf gan,ane singkat2 lagi ,jadi gini codingan nya,udah mentok ane cara buat form dinamis nya,ama cara input ke jtable,mana bentuk jtable nya kaya begitu gan,,kalau di php ane bisa mungkin gan,,kalau untuk java,(desktop) ane lemah gan



Spoilerfor Judul :



/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* form1.java
*
* Created on Dec 30, 2012, 10:31:52 AM
*/

package javaapplication5;
import java.sql.Connection;
import java.sql.SQLException;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import Database.DatabaseManager;



import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
* @author Kujil
*/
public class form1 extends javax.swing.JFrame {

/** Creates new form form1 */
public form1() {
initComponents();
}

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
namalokasi = new javax.swing.JTextField();
jumlahblok = new javax.swing.JTextField();
jPanel2 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setText("Nama Lokasi");

jLabel2.setText("Jumlah Blok");

jPanel2.setBorder(new javax.swing.border.MatteBorder(null));

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING )
.addGap(0, 555, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING )
.addGap(0, 388, Short.MAX_VALUE)
);

jButton1.setText("CREATE");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING )
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(24, 24, 24)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignme nt.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignme nt.TRAILING)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignme nt.LEADING)
.addComponent(namalokasi, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jumlahblok, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(40, 40, 40)
.addComponent(jButton1)))))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING )
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(41, 41, 41)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignme nt.BASELINE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(namalokasi, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignme nt.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jumlahblok, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(27, Short.MAX_VALUE))
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

pack();
}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
input_data(); // TODO add your handling code here:
}

/**
* @param args the command line arguments
*/

public void input_data(){
//panggil method koneksi
DatabaseManager db = new DatabaseManager();
db.connect();
Connection conn = db.getCon();




try{
String sql="insert into stock_rumah (lokasi,alamat,gambar) values(?,?,?,?,?,?,s?,?,?,?,?,)";
java.sql.PreparedStatement stmt=conn.prepareStatement(sql);

try{
stmt.setString(1,namalokasi.getText());
stmt.setString(2,jumlahblok.getText());


stmt.executeUpdate();
JOptionPane.showMessageDialog(null,"Data berhasil di simpan");
namalokasi.setText("");
jumlahblok.setText("");


}catch(SQLException se){
System.out.println("Gagal di simpan");
JOptionPane.showMessageDialog(null,"Data Gagal di simpan");
}
stmt.close();
}catch(Exception e){}

}

public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new form1().setVisible(true);
}
});
}



// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JTextField jumlahblok;
private javax.swing.JTextField namalokasi;
// End of variables declaration

}





Tidak ada komentar:

Posting Komentar