1 5 package net.sf.panoptes.swing.panels; 6 7 import java.awt.BorderLayout ; 8 import java.awt.Color ; 9 import java.awt.Font ; 10 11 import javax.swing.BorderFactory ; 12 import javax.swing.ImageIcon ; 13 import javax.swing.JLabel ; 14 import javax.swing.JPanel ; 15 import javax.swing.JSeparator ; 16 17 import com.jgoodies.forms.factories.Borders; 18 19 25 public class BannerPanel extends JPanel { 26 private JLabel descriptionLabel; 27 28 public BannerPanel(String shortDescription, String fullDescription, ImageIcon bannerIcon) { 29 setLayout(new BorderLayout ()); 30 setBackground(Color.WHITE); 31 32 JPanel descriptionPanel = new JPanel (new BorderLayout ()); 33 34 JLabel label = new JLabel (shortDescription); 35 label.setFont(label.getFont().deriveFont(Font.BOLD)); 36 descriptionPanel.add(label, BorderLayout.NORTH); 37 38 descriptionPanel.setBackground(Color.WHITE); 39 40 descriptionLabel = new JLabel (fullDescription); 41 descriptionPanel.add(descriptionLabel, BorderLayout.CENTER); 42 descriptionPanel.setBorder(Borders.DIALOG_BORDER); 43 44 add(descriptionPanel, BorderLayout.WEST); 45 add(new JLabel (bannerIcon), BorderLayout.EAST); 46 add(new JSeparator (), BorderLayout.SOUTH); 47 } 48 49 public JLabel getDescriptionLabel() { 50 return descriptionLabel; 51 } 52 } 53 | Popular Tags |