1 25 26 27 28 package net.yagga.miniinstaller.gui; 29 30 import java.awt.*; 31 import javax.swing.*; 32 import net.yagga.util.Ut; 33 34 38 public class DisplayPanel extends JPanel implements InstallPanel { 39 BorderLayout borderLayout1 = new BorderLayout(); 40 JScrollPane jScrollPane1 = new JScrollPane(); 41 JTextArea taText = new JTextArea(); 42 43 String text=""; 44 public DisplayPanel(String text) { 45 this.text=text; 46 try { 47 jbInit(); 48 } 49 catch (Exception ex) { 50 ex.printStackTrace(); 51 } 52 } 53 54 void jbInit() throws Exception { 55 this.setPreferredSize(InstallFrame.panelDim); 56 taText.setText(text); 57 taText.setWrapStyleWord(true); 58 taText.setLineWrap(true); 59 this.setLayout(borderLayout1); 60 this.add(jScrollPane1, BorderLayout.CENTER); 61 jScrollPane1.getViewport().add(taText,null); 62 refresh(); 63 } 64 65 public void refresh(){ 66 this.setBackground(InstallFrame.BK_COL); 67 this.setMaximumSize(InstallFrame.panelDim); 68 this.setPreferredSize(InstallFrame.panelDim); 69 this.setMinimumSize(InstallFrame.panelDim); 70 taText.setCaretPosition(0); 71 taText.setForeground(InstallFrame.FG_COL); 72 this.invalidate(); 73 } 74 75 } 76 77 | Popular Tags |