1 25 26 package net.yagga.miniinstaller.gui; 27 28 import java.awt.*; 29 import javax.swing.*; 30 import com.borland.jbcl.layout.*; 31 import net.yagga.util.Ut; 32 33 public class TitlePanel extends JPanel { 34 JLabel lbTitle = new JLabel(); 35 JSeparator spSep=new JSeparator(SwingConstants.HORIZONTAL); 36 37 String title; 38 39 GridBagLayout gridBagLayout1 = new GridBagLayout(); 40 JLabel shadow = new JLabel(); 41 42 JPanel thisPanel=null; 43 public TitlePanel(String title) { 44 this.title=title; 45 thisPanel=this; 46 try { 47 jbInit(); 48 } 49 catch (Exception ex) { 50 ex.printStackTrace(); 51 } 52 } 53 54 void jbInit() throws Exception { 55 56 this.setOpaque(true); 57 58 lbTitle.setText(title); 59 lbTitle.setOpaque(false); 60 61 this.setBackground(SystemColor.control); 62 lbTitle.setFont(GuiProperties.titleFont); 63 64 lbTitle.setForeground(InstallFrame.TITLE_COL); 65 66 javax.swing.border.EtchedBorder eBorder=new javax.swing.border.EtchedBorder (); 67 spSep.setBorder(eBorder); 68 spSep.setPreferredSize(new Dimension(0, 1)); 69 70 this.setLayout(gridBagLayout1); 71 77 this.add(spSep, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0 78 ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 3, 10), 100, 1)); 79 this.add(lbTitle, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 80 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 10), 100, 0)); 81 setTitle(title); 82 this.setBackground(InstallFrame.BK_COL); 83 84 lbTitle.setText("M:)"); 85 86 this.setMinimumSize(new Dimension(100, 30)); 87 this.setPreferredSize(new Dimension(100,(int)getPreferredSize().getHeight())); 88 } 90 void setTitle(String title){ 91 this.title=title; 92 lbTitle.setText(title); 93 } 95 96 public void refresh(){ 97 98 try { 99 jbInit(); 100 } 101 catch (Exception ex) { 102 ex.printStackTrace(); 103 } 104 } 105 106 107 } 108 109 110 | Popular Tags |