Bug 40638 [Dialogs] TitleAreaDialog is not initialized in the usual way.
When the TitleAreaDialog is constructed, it isn't ready to handle all of its mutators. In this snippet, the create() line is required, because otherwise setMessage() will throw a NullPointer when it attempts to modify the messageLabel; but it shouldn't be (according to Eclipse conventions). TitleAreaDialog titleAreaDialog = new TitleAreaDialog(getShell()); titleAreaDialog.create(); titleAreaDialog.setTitle("Title: org.eclipse.jface.dialogs.TitleAreaDialog"); titleAreaDialog.setMessage("Message: org.eclipse.jface.dialogs.TitleAreaDialog"); titleAreaDialog.open();
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/TitleAreaDialog.java
messageLabel.setText(" \n "); 
	messageLabel.setFont(JFaceResources.getDialogFont());
	
	
	leftFillerLabel = new Label(parent, SWT.CENTER);
	leftFillerLabel.setBackground(background);
	
	bottomFillerLabel = new Label(parent, SWT.CENTER);
	bottomFillerLabel.setBackground(background);
	
	setLayoutsForNormalMessage(verticalSpacing, horizontalSpacing);
	
	determineTitleImageLargest();
	if(titleImageLargest)
		return titleImage;
	else
		return messageLabel;
	
}
/**
 * Determine if the title image is larger than the title message
 * and message area. This is used for layout decisions.
 */
private void determineTitleImageLargest (){
	
	int titleY = titleImage.computeSize(SWT.DEFAULT,SWT.DEFAULT).y;
	
	int labelY = titleLabel.computeSize(SWT.DEFAULT,SWT.DEFAULT).y;
	labelY += messageLabel.computeSize(SWT.DEFAULT,SWT.DEFAULT).y;
	FontData[] data = messageLabel.getFont().getFontData();