Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Pertemuan 12(JTabel)

Pertemuan 12(JTabel)

Ratings: (0)|Views: 168|Likes:
Published by Kang Asep
modul pelatihan java
modul pelatihan java

More info:

Published by: Kang Asep on Sep 11, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

09/11/2011

pdf

text

original

 
Modul Pelatihan java Swing Asep Komarudin
 Jtabel
 Jtabel digunakan untuk menampilkan data dalam bentuk tabel,sebuahbentuk yang banyak digunakan dalam database.Contoh:public class ContohJtabel extends JFrame {String header []={"senin","selasa","rabu"};String data [][]={{"100","300","150"},{"200","400","200"},{"100","50","20"}};JTable table=new JTable(data, header);public ContohJtabel() {setLocation(200, 100);setSize(300, 100);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setTitle("contoh table");}public void tampilkanTabel(){getContentPane().add(table);setVisible(true);}/*** @param args the command line arguments*/
aasseepp@gmail.comPage 1
 
Modul Pelatihan java Swing Asep Komarudin
public static void main(String[] args) {// TODO code application logic hereContohJtabel cj=new ContohJtabel();cj.tampilkanTabel();}}Keluarannya adalah: JscrolPane JscrolPane adalah komponen yang digunakan untuk mengerakan keatas dankebawah atau kesamping, agar semua objek dapat terlilhat di layar.Konstruktor pada JscrolPane:KonstruktorKeterangan JscrolPane(Componen c)ScrolPane yang diletakan poadakompnen yag ditentukan JscropPane(Componen c,int I,int j)Scrol pane yang diletakan padakomponen yang ditentukan sertascrobar horizontal dan vertikal yangdikonvigurasi.Contoh kita bisa menambahkan kode diatas:
aasseepp@gmail.comPage 2
 
Modul Pelatihan java Swing Asep Komarudin
public class ContohJtabel extends JFrame {String header []={"senin","selasa","rabu"};String data [][]={{"100","300","150"},{"200","400","200"},{"100","50","20"},{"100","50","20"},{"100","50","20"},{"100","50","20"}};JTable table=new JTable(data, header);public ContohJtabel() {setLocation(200, 100);setSize(300, 100);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setTitle("contoh table");}public void tampilkanTabel(){JScrollPane jsp=new JScrollPane(table);getContentPane().add(jsp,BorderLayout.CENTER);setVisible(true);}/*** @param args the command line arguments*/
aasseepp@gmail.comPage 3

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->