1 19 20 package org.netbeans.modules.welcome.content; 21 22 import java.io.IOException ; 23 import javax.swing.BorderFactory ; 24 import javax.swing.JComponent ; 25 import javax.swing.JLabel ; 26 import javax.swing.JScrollPane ; 27 import javax.xml.parsers.ParserConfigurationException ; 28 import org.openide.ErrorManager; 29 import org.xml.sax.SAXException ; 30 31 36 public class ContentFactory { 37 38 private ContentFactory() { 39 } 40 41 46 public static JComponent createContentPane() { 47 ContentParser parser = new ContentParser(); 48 try { 49 50 parser.parseLocal(); 51 JScrollPane scroll = new JScrollPane ( new DefaultContentPane( parser.getContents(), parser.getBackgroundPainter() ) ); 52 scroll.setFocusable( false ); 53 scroll.setBorder( BorderFactory.createEmptyBorder() ); 54 return scroll; 55 56 } catch( IOException ioE ) { 57 ErrorManager.getDefault().notify( ErrorManager.INFORMATIONAL, ioE ); 58 } catch( SAXException saxE ) { 59 ErrorManager.getDefault().notify( ErrorManager.INFORMATIONAL, saxE ); 60 } catch( ParserConfigurationException pcE ) { 61 ErrorManager.getDefault().notify( ErrorManager.INFORMATIONAL, pcE ); 62 } 63 return new JLabel ( BundleSupport.getLabel( "ErrParsingLayout" ) ); } 65 } 66 | Popular Tags |