Program Pecah Kata (Netbeans)

Waahhh ternyata sudah lama nee saya gak posting sesuatu di blog ini....
mumpung ada waktu, saya sekarang akan share bagaimana membuat program pemecah kata menggunakan Java Netbeans tentunya dengan interfacenya..
:) berikut tampilan awal dari interfacenya :
Nah untuk komponen - komponen yang saya gunakan antara lain : 
Komponen Swing Controls
Name
Variable Name
JLabel1
Program Pemecah Kata
-
JLabel2
Sistem Temu Kembali Informasi (B)
-
JLabel3
Kalimat :
-
JTextArea
-
AreaInput
JButton1
Proses
btnProses
JButton2
Reset
btnReset
JTable1
Kata
TabelOut
Varible name bisa di ubah sesuai dengan keinginan anda sendiri, dan akan melakukan sedikit perubahan pada source code...

nah untuk source code dari program di atas berikut ini :
package stki;
import javax.swing.table.DefaultTableModel;

public class tokenisasi extends javax.swing.JFrame {
    DefaultTableModel model;

    public tokenisasi() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
  
    private void btnProsesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        String Kalimat = AreaInput.getText();
        String kata[] = Kalimat.split(" ");
        String header[] = {"Kata"};
        Object data [][] = new Object[1000][1];
        for(int a=0;a<kata.length;a++){
            data[a][0]=kata[a];
        }
        model = new DefaultTableModel(data,header);
        TabelOut.setModel(model);
    }

    private void btnResetActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        AreaInput.setText("");
    }


    public static void main(String args[]) {
       
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new tokenisasi().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify
    private javax.swing.JTextArea AreaInput;
    private javax.swing.JTable TabelOut;
    private javax.swing.JButton btnProses;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    // End of variables declaration
}

berikut ini adalah hasil running dari program di atas :
selamat mencoba, dan semoga tulisan yang saya buat ini dapat bermanfaat bagi kita semua...
amin....
^_^

2 komentar:

Unknown mengatakan...

Terima kasih untuk scriptnya.. bagaimana cara menambahkan script untuk menghitung jumlah kemunculan kata dan merubahnya menjadi huruf kecil? Jika ingin ditambahkan dimana posisi scriptnya diletakkan?

Blog27999 mengatakan...

You should see how my acquaintance Wesley Virgin's adventure launches in this shocking and controversial video.

You see, Wesley was in the army-and shortly after leaving-he unveiled hidden, "MIND CONTROL" tactics that the CIA and others used to get anything they want.

These are the EXACT same methods lots of famous people (notably those who "come out of nothing") and top business people used to become wealthy and successful.

You probably know how you utilize only 10% of your brain.

That's because the majority of your BRAINPOWER is UNCONSCIOUS.

Maybe this conversation has even occurred INSIDE your very own head... as it did in my good friend Wesley Virgin's head around 7 years back, while riding an unregistered, beat-up trash bucket of a car without a license and $3 on his banking card.

"I'm very fed up with living paycheck to paycheck! Why can't I turn myself successful?"

You've been a part of those those types of questions, isn't it so?

Your own success story is going to happen. All you have to do is in YOURSELF.

Take Action Now!

Posting Komentar