From 63600e33e736021dd4c669d33e52fcbe4b5b5218 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 27 Jan 2022 22:43:17 -0500 Subject: [PATCH] horizontal fill --- .../ui/src/main/java/com/rusefi/ui/LiveDataPane.java | 8 ++++++-- .../src/test/java/com/rusefi/ui/LiveDataPaneSandbox.java | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/java_console/ui/src/main/java/com/rusefi/ui/LiveDataPane.java b/java_console/ui/src/main/java/com/rusefi/ui/LiveDataPane.java index 96391dfc7e..9ca1cdad45 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/LiveDataPane.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/LiveDataPane.java @@ -8,6 +8,7 @@ import com.rusefi.ldmp.StateDictionary; import com.rusefi.livedata.LiveDataParserPanel; import com.rusefi.ui.util.UiUtils; import com.rusefi.ui.widgets.IntGaugeLabel; +import net.miginfocom.swing.MigLayout; import org.jetbrains.annotations.NotNull; import org.putgemin.VerticalFlowLayout; @@ -16,6 +17,8 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static com.rusefi.autoupdate.AutoupdateUtil.wrap; + /** * Andrey Belomutskiy, (c) 2013-2020 @@ -34,7 +37,8 @@ public class LiveDataPane { public LiveDataPane(UIContext uiContext) { - JPanel vertical = new JPanel(new VerticalFlowLayout()); + JPanel vertical = new JPanel(new MigLayout("wrap 1", "[grow,fill]")); + vertical.setBorder(BorderFactory.createLineBorder(Color.orange)); JScrollPane scroll = new JScrollPane(vertical, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); JPanel legend = populateLegend(); @@ -53,7 +57,7 @@ public class LiveDataPane { }); leftList.add(shortCut); - vertical.add(liveDataParserContent); + vertical.add(liveDataParserContent, "grow, wrap"); } content.add(leftList, BorderLayout.WEST); diff --git a/java_console/ui/src/test/java/com/rusefi/ui/LiveDataPaneSandbox.java b/java_console/ui/src/test/java/com/rusefi/ui/LiveDataPaneSandbox.java index 4e28b36fce..cd97aef2dd 100644 --- a/java_console/ui/src/test/java/com/rusefi/ui/LiveDataPaneSandbox.java +++ b/java_console/ui/src/test/java/com/rusefi/ui/LiveDataPaneSandbox.java @@ -2,9 +2,11 @@ package com.rusefi.ui; import com.rusefi.ui.util.FrameHelper; +import javax.swing.*; + public class LiveDataPaneSandbox { public static void main(String[] args) { UIContext uiContext = new UIContext(); - new FrameHelper().showFrame(new LiveDataPane(uiContext).getContent()); + new FrameHelper(WindowConstants.EXIT_ON_CLOSE).showFrame(new LiveDataPane(uiContext).getContent()); } }