I have a programm I am supposed to show off on a screen that is significantly smaller than the one it was developed on and it makes it unusable due to an autosized textfield getting downsized to 0. In order to solve this problem, I want to set the size of the tables to a max size so that the textfields have enough space.
basically, I have a customtablemodel in a JTable in a JScrollPane in a JPanel with BoxLayout in a Applet.
Now, I know this isn't the best solution, since I have to scroll in the tables, but I need to be able to show the programm off at least.
firsttablepane = new JScrollPane(firsttable);
firstmodel.addColumn("Vorname");
firstmodel.addColumn("Nachname");
firstmodel.addColumn("Benutzername");
firstmodel.addColumn("Access");
firsttable.setModel(firstmodel);
try {
gui.guirs1 = gui.sqlc.executeSQLStatement("SELECT LID,Loginname,Vorname,Nachname,Access FROM login WHERE Geloescht=0;", (byte) 1);
while(gui.guirs1.next()) {
try {
firstmodel.addRow(new Object[] {
gui.guirs1.getString("Vorname"), gui.guirs1.getString("Nachname"), gui.guirs1.getString("Loginname"), gui.guirs1.getString("Access")
});
} catch(Exception exce) {
exce.printStackTrace();
}
}
ListSelectionModel listMod = firsttable.getSelectionModel();
listMod.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
//buff.populate(gui.guirs) ;
//gui.sqlc.closeConnection();
} catch(SQLException e1) {
e1.printStackTrace();
}
firsttable.setAutoscrolls(false);
firsttable.setDragEnabled(false);
firsttable.setAutoCreateColumnsFromModel(false);
leftpanel.add(firsttablepane, BorderLayout.LINE_START);