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.