protected JComponent createControl ( ) { // In this view, we're just going to use standard Swing to place a // few controls. // The location of the text to display has been set as a Resource in the // property descriptionTextPath. So, use that resource to obtain a URL // and set that as the page for the text pane. JTextPane textPane = new JTextPane ( ) ; JScrollPane spDescription = getApplicationConfig ( ) . componentFactory ( ) . createScrollPane ( textPane ) ; try { textPane . setPage ( getDescriptionTextPath ( ) . getURL ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( "Unable to load description URL" , e ) ; } JLabel lblMessage = getApplicationConfig ( ) . componentFactory ( ) . createLabel ( getFirstMessage ( ) ) ; lblMessage . setBorder ( BorderFactory . createEmptyBorder ( 5 , 0 , 5 , 0 ) ) ; JPanel panel = getApplicationConfig ( ) . componentFactory ( ) . createPanel ( new BorderLayout ( ) ) ; panel . add ( spDescription ) ; panel . add ( lblMessage , BorderLayout . SOUTH ) ; return panel ; }
Create the actual UI control for this view . It will be placed into the window according to the layout of the page holding this view .