The new "Don't show this message again" feature in the session closing and unsaved changes dialog is a nice touch. But, currently the new dialog doesn't work quite as well as before. For example if you have a long filename, some of the text and buttons can get cut off.
I would like to suggest a couple changes to make it a little better, more like a built-in dialog:
I have attached some (Git) patches that accomplish this. The first patch just makes the changes mentioned above. Unfortunately, the MultilineLabel class that is currently used doesn't seem to report a correct preferred size to the layout manager, so I created a different way to display the message - a panel with one JLabel per line of text. I think this is what Java does internally for the JOptionPane. The second patch (applied on top of the first) makes the dialog look even more like the JOptionPane one by adding back the question mark icon and adding space between the lines in the message.
The third patch (independent of the others) is a suggestion regarding the text of the unsaved changes dialog box. A couple things have stuck out to me for a while but not big enough of a deal to mention before:
Thanks for the patches.
I took several parts of them but kept resizability and the multi line label so that files paths may take more than one line.
Cool. That looks much nicer. I have a couple more suggestions:
It would probably be good to make the question mark icon only span one row (patch #1) if you are going to have the checkbox start in the left column so that they don't collide. Stretch the session closing dialog so the message is only on one line to see this. (My version had it spanning two rows because I only had the checkbox in the right column.)
Also, I was able to figure out a way to keep the resize-ability but also ensure that nothing will be cut off. It appears that a JTextArea with setLineWrap(true) does calculate an appropriate preferred size, but only after it is visible. Patch #2 auto-sizes the dialog height only when it is first shown. Patch #3 auto-sizes the height when it is shown and when it is resized (timer is just to reduce jerkiness/flickering).
The code I used keeps the dialog's current width but always sets the height to the preferred height (which could be larger or smaller than current). I thought of two other options. The built-in pack() sets both height and width to the preferred values (which might reduce the width if there is a short filename or "Unspecified"). You could also compare preferred height with current height and only resize if the preferred height is greater (increase height when needed but never decrease).
Thanks again for the patches. It took the first two.
I skipped the third because I didn't like the idea of correcting resizes done by the user when the dialog is displayed. Besides this it didn't work on my Linux box.