JAVA - How To Bind Data In JTable In Netbeans

JAVA - How To Fill Data In JTable In Java Netbeans.


__________________________________________________________________________

In This Java Code We Will See How To Populate  A  JTable  Using  In   Java   NetBeans Programming Language.

Source Code: 

package javadb_001;

import javax.swing.*;


public class To_JTable extends JFrame  {
    Object row[][] = {{"A","B","C"},{"D","E","F"},{"J","H","I"},{"G","K","L"},
                      {"D","E","F"},{"J","H","I"},{"G","K","L"},
                      {"D","E","F"},{"J","H","I"},{"G","K","L"},
                      {"D","E","F"},{"J","H","I"},{"G","K","L"},
                      {"A","B","C"},{"D","E","F"},{"J","H","I"},{"G","K","L"},
                      {"A","B","C"},{"D","E","F"},{"J","H","I"},{"G","K","L"},
                      };
    Object column[] = {"1","1","3"};
    JTable jt;
    JScrollPane js;
    public Mysql_To_JTable()
    {
       super("Mysql TO JTable");

       this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

       jt = new JTable(row, column);

       js = new JScrollPane(jt);

       this.setSize(500, 300);

       this.setLocationRelativeTo(null);

       this.add(js);

       this.setVisible(true);
    }

    public static void main(String[] args)
    {
        new To_JTable();
    }
}





Share this

Related Posts

Previous
Next Post »

1 comments:

comments