This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 20570
Collapse All | Expand All

(-)NbPresenter.java (+30 lines)
Lines 70-75 Link Here
70
    private final static String CANCEL_COMMAND = "Cancel"; // NOI18N
70
    private final static String CANCEL_COMMAND = "Cancel"; // NOI18N
71
    
71
    
72
    private Component currentMessage;
72
    private Component currentMessage;
73
    private JScrollPane currentScrollPane;
74
    
73
    private JPanel currentButtonsPanel;
75
    private JPanel currentButtonsPanel;
74
    private Component[] currentPrimaryButtons;
76
    private Component[] currentPrimaryButtons;
75
    private Component[] currentSecondaryButtons;
77
    private Component[] currentSecondaryButtons;
Lines 227-239 Link Here
227
            } else {
229
            } else {
228
                currentMessage = createOptionPane();
230
                currentMessage = createOptionPane();
229
            }
231
            }
232
            Dimension size = currentMessage.getPreferredSize();
233
            final Dimension screenSize = Utilities.getScreenSize();
234
            
235
            if (size.width > screenSize.width - 100
236
                || size.height > screenSize.height- 100
237
                ) {
238
                currentScrollPane = new JScrollPane() {
239
                    public Dimension getPreferredSize() {
240
                        Dimension sz = new Dimension(super.getPreferredSize());
241
                        if (sz.width > screenSize.width - 100) {
242
                            sz.width = screenSize.width * 3 / 4;
243
                        }
244
                        if (sz.height > screenSize.height - 100)
245
                            sz.height = screenSize.height * 3 / 4;
246
                        return sz;
247
                    }
248
                };
249
                currentScrollPane.setViewportView(currentMessage);
250
                getContentPane().add(currentScrollPane, BorderLayout.CENTER);
251
            }
252
            else {
230
            getContentPane().add(currentMessage, BorderLayout.CENTER);
253
            getContentPane().add(currentMessage, BorderLayout.CENTER);
231
        }
254
        }
232
    }
255
    }
256
    }
233
    
257
    
234
    private void uninitializeMessage() {
258
    private void uninitializeMessage() {
235
        if (currentMessage != null) {
259
        if (currentMessage != null) {
260
            if (currentScrollPane != null) {
261
                getContentPane().remove(currentScrollPane);
262
                currentScrollPane = null;
263
            }
264
            else {
236
            getContentPane().remove(currentMessage);
265
            getContentPane().remove(currentMessage);
266
            }
237
            currentMessage = null;
267
            currentMessage = null;
238
        }
268
        }
239
    }
269
    }

Return to bug 20570