@Override
		public Dimension getPreferredSize() {
			Dimension prefSize = super.getPreferredSize();

			// create date 2000-11-30 that is used for minimum width calculation
			Calendar calendar = Calendar.getInstance( datePicker.getLocale() );
			calendar.set( 2000, 11, 30 );

			try {
				AbstractFormatter formatter = getFormatter();
				String str = formatter.valueToString( calendar.getTime() );

				Insets insets = getInsets();
				FontMetrics metrics = getFontMetrics( getFont() );
				int minWidth = metrics.stringWidth( str ) + insets.left + insets.right + 2;
				return new Dimension( Math.max( minWidth, prefSize.width ), prefSize.height );
			} catch( ParseException ex ) {
				// ignore
				return prefSize;
			}
		}
Provides the Flat LaF UI delegate for {@link org.jdesktop.swingx.JXDatePicker}.

@author Karl Tauber
flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerUI.java