In my JDialog, when the title is too long the tile gets truncated and gets displayed as 'THIS IS MY T..'.
I just want to set the width of my JDialog corresponding to my TITLE STRING Length.
Good usability dictates, the the Title should be short and concise. Like "Error" or "Open" or "Confirm". If you want to display more detailed information, you can make it a part of the message being displayed in the dialog.
Sorry for the late response. I managed to get this done.
I get the font used to paint the FRAME TITLE from the Look And Feel used. With the font create the Font Metrics. From the Font Metrics, get the width.
Below is the piece of code that I have used.