I have used a JTable only for the alignement of the values I want to display.
So far I my table looks like this:
What I want is to delete the margin of the table, so it can't be noticed that it is a table. Is there a way to make this possible?
My code:
displayNames = new ArrayList<String>();
displayClasses = new ArrayList<String>();
for (int i=0; i<displayName.size(); i++) {
displayNames.add(displayName.get(i));
displayClasses.add(classes.get(i));
}
Object rowData[][] = { displayNames.toArray(), displayClasses.toArray() };
Object columnNames[] = displayNames.toArray();
JTable table = new JTable(rowData, columnNames);
table.setTableHeader(null);
table.setShowGrid(false);
table.setBackground(Color.LIGHT_GRAY);
tablePane = new JScrollPane(table);
tablePane.setPreferredSize(new Dimension(765,40));
tablePane.setBackground(Color.LIGHT_GRAY);
rightPanel.removeAll();
rightPanel.updateUI();
rightPanel.add(tablePane);
public void showGUI() {
JFrame frame = new JFrame();
frame.add(leftPanel,BorderLayout.EAST);
frame.add(listScrollPane,BorderLayout.WEST);
frame.add(rightPanel);
frame.setSize(1000,500);
frame.setLocation(200,100);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}