In this case I use NetBeans 7.3.1, now we create package and named UrutDaftarHarga, like this.
After we create package with named UrutDaftarHarga, then next Step we create jFrame, like this.
and named UrutDaftarHargaDenganDatabaseMySQL, like this.
then next step, we create design form, like this.
after create design form, at button Simpan right click, search Events => Action => action..... like this.
Then Insert Source Code for Button Simpan, like this.
but, before insert Source Code For Button Simpan, we must insert source Code For Import and create procedure for connection to database MySQL with driver JDBC.First we Add JAR/Folder like this.
after we add driver JDBC, then we insert Source Code for import, like this.
this Source Code for Connection,
then, at form right click, search Events => Window => window.... like this.
then, insert Source Code for form view Data.
then, back to design, right ctrl at button Keluar, search Events => Action => action....like this.
then, insert Source Code, this Source Code for exit from application. like this.
Now, we run application, go to run => Run File, like this.
wait a few second, then will show Form like this.
Insert Produk with "Baju", and Harga with "50000", like this.
then, click button Simpan, then will show message box like this.
Click Ok, then will show like this.
insert until 5 record, like this.
Now we See at Database MySQL, like this.
What do you see?, at field harga not sorted, you can see again at form we made before, harga already sorted Descending.
Ok, this is my Simple Applications For Input and View Data Using MySQL with Java Sort By Harga Descending. I Hope this is useful for you. thanks.
0 comments:
Post a Comment