public JComponent createScreenComponent ( Converter fieldInfo ) { int iRows = 1 ; int iColumns = fieldInfo . getMaxLength ( ) ; if ( iColumns > 40 ) { iRows = 3 ; iColumns = 30 ; } String strDefault = fieldInfo . toString ( ) ; if ( strDefault == null ) strDefault = Constants . BLANK ; JComponent component = null ; if ( iRows <= 1 ) { component = new JTextField ( strDefault , iColumns ) ; if ( fieldInfo instanceof FieldInfo ) if ( Number . class . isAssignableFrom ( ( ( FieldInfo ) fieldInfo ) . getDataClass ( ) ) ) ( ( JTextField ) component ) . setHorizontalAlignment ( JTextField . RIGHT ) ; } else { component = new JTextArea ( strDefault , iRows , iColumns ) ; component . setBorder ( m_borderLine ) ; } return component ; }
Add the screen controls to the second column of the grid . Create a default component for this fieldInfo .