I added a JTable in a JFrame using drag and drop in netbeans.
I was able to display the contents of the database but it is not like what i want to display, i want strings with newlines to be display as multiple lines.
i have a code here that query in the sqlite database and then displayed it in the table.
public void Update_table_RFID(JTable x){
try{
String sql = " select RFID as 'RFID Tag', Word, ARF as 'Audio Recording File', "
+ " DateAdded as 'Date Added', TimeAdded as 'Time Added' "
+ " from RFID";
pst = conn.prepareStatement(sql);
rs = pst.executeQuery();
x.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
}
but the output i got instead is this:
what do i need to do to display the correct output of the query in the table?
`tag. For this case you'll need your own table model or at least your own cell renderer. Also it's required to update height for each row in table. For this purpose see the method `JTable#setRowHeight(int row, int height)`. Also please read about [Tables in Swing](https://docs.oracle.com/javase/tutorial/uiswing/components/table.html) – Sergiy Medvynskyy Apr 13 '17 at 07:40