diff --git a/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java b/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java index 909dca0f12c7..e6f0b03077bc 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java @@ -195,10 +195,7 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene JBLabel attachmentsLabel = new JBLabel(DiagnosticBundle.message("error.dialog.attachments.prompt")); - Dimension listSize = JBUI.size(150, 400), areaSize = JBUI.size(500, 400); - myAttachmentsList = new AttachmentsList(); - myAttachmentsList.setMinimumSize(listSize); myAttachmentsList.addListSelectionListener(e -> { int index = myAttachmentsList.getSelectedIndex(); if (index < 0) { @@ -219,8 +216,6 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene }); myAttachmentArea = new JTextArea(); - myAttachmentArea.setMinimumSize(areaSize); - myAttachmentArea.setPreferredSize(areaSize); myAttachmentArea.setMargin(JBUI.insets(2)); myAttachmentArea.setEditable(false); @@ -262,13 +257,13 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene JPanel commentPanel = new JPanel(new BorderLayout()); commentPanel.setBorder(JBUI.Borders.emptyTop(5)); commentPanel.add(commentLabel, BorderLayout.NORTH); - commentPanel.add(scrollPane(myCommentArea), BorderLayout.CENTER); + commentPanel.add(scrollPane(myCommentArea, 0, 0), BorderLayout.CENTER); JPanel attachmentsPanel = new JPanel(new BorderLayout(JBUI.scale(5), 0)); attachmentsPanel.setBorder(JBUI.Borders.emptyTop(5)); attachmentsPanel.add(attachmentsLabel, BorderLayout.NORTH); - attachmentsPanel.add(scrollPane(myAttachmentsList), BorderLayout.WEST); - attachmentsPanel.add(scrollPane(myAttachmentArea), BorderLayout.CENTER); + attachmentsPanel.add(scrollPane(myAttachmentsList, 150, 400), BorderLayout.WEST); + attachmentsPanel.add(scrollPane(myAttachmentArea, 500, 400), BorderLayout.CENTER); JPanel bottomRow = new JPanel(new BorderLayout()); if (myInternalMode) { @@ -277,15 +272,18 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene bottomRow.add(myCredentialsLabel, BorderLayout.EAST); JPanel rootPanel = new JPanel(new BorderLayout()); + rootPanel.setPreferredSize(JBUI.size(600, 400)); rootPanel.add(commentPanel, BorderLayout.NORTH); rootPanel.add(attachmentsPanel, BorderLayout.CENTER); rootPanel.add(bottomRow, BorderLayout.SOUTH); return rootPanel; } - private static JScrollPane scrollPane(JComponent component) { + private static JScrollPane scrollPane(JComponent component, int width, int height) { JScrollPane scrollPane = new JBScrollPane(component); - scrollPane.setMinimumSize(component.getMinimumSize()); + if (width > 0 && height > 0) { + scrollPane.setMinimumSize(JBUI.size(width, height)); + } return scrollPane; }