Skip to content

Commit

Permalink
Added scrollbar as fallback for os that allows resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
mtygesen committed Oct 8, 2023
1 parent 8b3d7f9 commit 85dc711
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ public void fireDone(boolean cancelled) {
this.getRootPane().setDefaultButton(drawButton);
drawButton.requestFocus();

setContentPane(mainPanel);

int extraWidth = 100;

Dimension preferredSize = mainPanel.getPreferredSize();
Expand All @@ -255,6 +253,13 @@ public void fireDone(boolean cancelled) {
Dimension newPreferredSize = new Dimension(preferredWidth, preferredHeight);

mainPanel.setPreferredSize(newPreferredSize);

JScrollPane scrollPane = new JScrollPane(mainPanel);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setBorder(null);

setContentPane(scrollPane);
}

private void initAdvancedOptionsPanel() {
Expand Down

0 comments on commit 85dc711

Please sign in to comment.