fmtStr = new DateFormatter( pattern ).format( new Date( text ) );
fmtStr = new DateFormatter( pattern, ULocale.getDefault( ) ) .format( new Date( text ) );
	private void updatePreview( )	{		markDirty( hasLoaded );		String category = getCategory4UIDisplayName( typeChoicer.getText( ) );		setCategory( category );		Date sampleDateTime = defaultDate;		if ( getPreviewText( ) != null				&& !getPreviewText( ).equals( defaultDateTime ) )		{			try			{				sampleDateTime = new Date( getPreviewText( ) );			}			catch ( Exception e )			{				// do nothing, leave sampleDate to be defaultDate.			}		}		if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM.equals( category ) )		{			String pattern = formatCode.getText( );			String fmtStr;			String text = previewTextBox.getText( );			if ( StringUtil.isBlank( text ) || defaultDateTime.equals( text ) )			{				fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			}			else			{				try				{					fmtStr = new DateFormatter( pattern ).format( new Date( text ) );				}				catch ( Exception e )				{					fmtStr = PREVIEW_TEXT_INVALID_DATETIME_TO_PREVIEW;				}			}			cusPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );		}		else		{			String pattern = null;			if ( !DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED.equals( category ) )			{				pattern = FormatDateTimePattern.getPatternForCategory( category );			}			String fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );		}		return;	}