String column_names[]= {"Serial Number","Medicine Name","Dose","Frequency"}; table_model=new DefaultTableModel(column_names,3); table=new JTable(table_model);
We want to set header with names of columns as in column_names with the above code but it is not working. Header is not visible though table is getting created.