I am trying to show some data on the JTables:
private JTable table1 = new JTable() {
private static final long serialVersionUID = 1L;
@Override
public boolean isCellEditable(int row, int column) {
return false;
}
};
private JScrollPane secTabFirst() {
Object [][] data = {{"90"},{"1700"},{"60"},{"0.7"}, {"Globular"}, {"Sinusoidal"}};
String[] columnNames = {"Parameters"};
DefaultTableModel model = new DefaultTableModel(data, columnNames);
table1.setModel(model);
table1.setTableHeader(null);
table1.setShowHorizontalLines(true);
table1.setShowVerticalLines(true);
//table1.setPreferredSize(new Dimension(150,240));
//table1.setMaximumSize(new Dimension(150,240));
JScrollPane tb1 = new JScrollPane(table1);
tb1.setVisible(true);
return tb1;
}
public static void main(String args[]){
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.add(secTabFirst());
}
The JTables are shown like these:

But the upper and left lines of the table are invisible. Also, it displays 2 dark-boxes after placing the tables in JScrollPane.
How can I make the lines visible and the dark-boxes disappear?
Thanks,
MB

