1 19 20 package org.netbeans.modules.welcome.content; 21 22 import java.awt.Graphics ; 23 import java.awt.GridBagLayout ; 24 import javax.swing.JPanel ; 25 26 31 class DefaultContentPane extends JPanel { 32 33 private BackgroundPainter painter; 34 35 36 public DefaultContentPane( ComponentDescriptor[] contents, BackgroundPainter painter ) { 37 super( new GridBagLayout () ); 38 39 setOpaque( false ); 40 setFocusable( false ); 41 42 this.painter = painter; 43 44 for( int i=0; i<contents.length; i++ ) { 45 add( contents[i].construct(), contents[i].getConstraints() ); 46 } 47 } 48 49 protected void paintComponent(Graphics g) { 50 if( null != painter ) 51 painter.paintComponent( this, g ); 52 } 53 } 54 | Popular Tags |