[#2152] Fix table column width changing

This commit is contained in:
SiboVG 2023-03-29 19:03:31 +02:00
parent 6084ba6512
commit 3a41ea40e3
3 changed files with 4 additions and 2 deletions

View File

@ -25,6 +25,8 @@ public class MotorMountConfigurationPanel extends JPanel {
table.setShowVerticalLines(false);
table.setRowSelectionAllowed(false);
table.setColumnSelectionAllowed(false);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.setAutoCreateColumnsFromModel(false);
TableColumnModel columnModel = table.getColumnModel();
TableColumn col0 = columnModel.getColumn(0);

View File

@ -24,7 +24,7 @@ class MotorMountTableModel extends AbstractTableModel implements ComponentChange
private final Rocket rocket;
/**
* @param motorConfigurationPanel
* @param rocket the rocket to select motor mounts from
*/
MotorMountTableModel( Rocket rocket) {
this.rocket = rocket;

View File

@ -76,7 +76,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
BorderFactory.createEtchedBorder(),
"<html><b>" + trans.get("lbl.motorMounts") + "</b></html>"));
MotorMountConfigurationPanel mountConfigPanel = new MotorMountConfigurationPanel(this, rocket);
MotorMountConfigurationPanel mountConfigPanel = new MotorMountConfigurationPanel(subpanel, rocket);
subpanel.add(mountConfigPanel, "grow, pushy");
this.add(subpanel, "split, growy, pushy");
}