JDK-6925473 : REGRESSION: JOptionPane in dialog is full-screen height
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2010-02-11
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b97Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication1;

import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;

/**
 *
 * @author jirka
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        JPanel p = new JPanel();
        JTextArea ta = new JTextArea("Settings created by a previous version of the IDE were found on your system at /home/jirka/. Do you want to import them?");
        ta.setLineWrap(true);
        JOptionPane op = new JOptionPane (
            ta,
            JOptionPane.QUESTION_MESSAGE,
            JOptionPane.YES_NO_OPTION
        );
        JDialog d = op.createDialog(null, "Confirm Import Settings");
        d.setVisible (true);
        System.exit(0);
    }

}
Filed alsa as NetBeans P2 issue: https://netbeans.org/bugzilla/show_bug.cgi?id=179525

Comments
EVALUATION The fix of CR 6491856 produced a lot of regressions, therefore I believe the best way to restore functionality is to revert that fix. My fix reverts http://javaweb.sfbay/jcg/7/swing/6491856/ and CR 6593649 (the last bug is a regression from CR 6491856 as well) After this fix we can close a couple of important CRs: P2 6925473 (REGRESSION: JOptionPane in dialog is full-screen height) P3 6940863 (Textarea within scrollpane shows vertical scrollbar) I'm going to reopen CR 6491856 (a P4 bug) and we will try to fix it in another way...
18-02-2010

EVALUATION This is a real bug, the problem is related to the line wrap property, if you comment out ta.setLineWrap(true); the dialog will be properly sized
11-02-2010