Merge pull request #2155 from SiboVG/issue-2152

[#2152] Fix table column width changing
This commit is contained in:
Sibo Van Gool 2023-03-30 19:00:18 +02:00 committed by GitHub
commit 8de28fd35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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");
}