I wrote the following Code and strangely it isn't showing the column Names....
The mistake should be foolish..but i can't figure it out...
can you please help.. or give any alternate way to do the same
import javax.swing.*;
import javax.swing.table.*;
public class test
{
public static String[] columnNames = {"User Name","User ID"};
public static void main(String args[])
{
JFrame frame = new JFrame();
frame.setSize(400, 400);
DefaultTableModel tabmodel = new DefaultTableModel(columnNames, 15);
JTable table = new JTable(tabmodel);
frame.add(table);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}