1 25 26 package net.yagga.miniinstaller.gui; 27 28 import java.awt.*; 29 import java.io.*; 30 import javax.swing.*; 31 import java.awt.event.*; 32 import net.yagga.util.Ut; 33 34 public class FinalPanel extends WritePanel 35 implements ActionListener { 36 37 private String shellCaption; 38 39 private FinalExecuter fExec; 40 BorderLayout borderLayout1 = new BorderLayout(); 41 Box box1; 42 JCheckBox ckLaunch = new JCheckBox(); 43 JLabel jLabel1 = new JLabel(); 44 45 public FinalPanel(FinalExecuter fExec, String title, String msg, String shellCaption){ 46 super(title,msg,null); 47 this.fExec=fExec; 48 this.shellCaption=shellCaption; 49 try { 50 jbInit2(); 51 } 52 catch (Exception ex) { 53 ex.printStackTrace(); 54 } 55 } 56 57 private void jbInit2() throws Exception { 58 super.jbInit(); 59 box1 = Box.createVerticalBox(); 60 if(shellCaption!=null){ 61 Box box=Box.createHorizontalBox(); 62 ckLaunch.setAlignmentX((float) 1.0); 63 ckLaunch.setHorizontalAlignment(SwingConstants.CENTER); 64 ckLaunch.setText(""); 66 jLabel1.setAlignmentX((float) 0.5); 67 jLabel1.setHorizontalAlignment(SwingConstants.CENTER); 68 jLabel1.setHorizontalTextPosition(SwingConstants.CENTER); 69 jLabel1.setText("Check here to execute on exit:"); 70 jLabel1.setFont(GuiProperties.textFont); 71 72 this.add(box, BorderLayout.CENTER); 73 this.add(box1, BorderLayout.SOUTH); 74 box1.add(jLabel1, null); 75 box1.add(ckLaunch, null); 76 ckLaunch.setText(shellCaption); 77 ckLaunch.addActionListener(this); 78 ckLaunch.setOpaque(false); 79 ckLaunch.setFont(GuiProperties.makeBold(GuiProperties.textFont)); 80 } 81 } 82 83 public void refresh(){ 84 super.refresh(); 85 if(ckLaunch!=null) 86 ckLaunch.setForeground(InstallFrame.FG_COL); 87 if(jLabel1!=null) 88 jLabel1.setForeground(InstallFrame.FG_COL); 89 } 90 91 public void actionPerformed(ActionEvent e){ 92 if(e.getSource()==ckLaunch) 93 fExec.executeShellOnExit(ckLaunch.isSelected()); 94 } 95 96 } | Popular Tags |