Code example for JLabel

Methods: getText

0
 
		JTextField textField = (JTextField) metawidget.getComponent( 1 );
		DateFormat dateFormat = new SimpleDateFormat( DATE_FORMAT );
		assertEquals( dateFormat.format( dateFirst ), textField.getText() );
		JLabel label = (JLabel) metawidget.getComponent( 5 );
		assertEquals( "Not settable", label.getText() );
 
		JTextField nestedTextField = (JTextField) ( (SwingMetawidget) metawidget.getComponent( 3 ) ).getComponent( 1 );
		assertEquals( "", nestedTextField.getText() );
 
		JTextField nestedNestedTextField = (JTextField) ( (SwingMetawidget) ( (SwingMetawidget) metawidget.getComponent( 3 ) ).getComponent( 3 ) ).getComponent( 1 );
		assertEquals( dateFormat.format( scalaFoo3.bar() ), nestedNestedTextField.getText() );
 
		// Saving 
 
		Date dateSecond = new GregorianCalendar( 1976, Calendar.MAY, 10 ).getTime();
		textField.setText( dateFormat.format( dateSecond ) );
		nestedNestedTextField.setText( dateFormat.format( new GregorianCalendar( 1977, Calendar.JUNE, 17 ).getTime() ) );
		metawidget.getWidgetProcessor( BeanUtilsBindingProcessor.class ).save( metawidget );