1 23 24 package org.infoglue.cmsinstaller; 25 import javax.swing.*; 26 import java.awt.*; 27 28 31 32 public class FinishDialog extends JPanel 33 { 34 private InfoGlueInstaller infoGlueInstaller = null; 35 36 private final static String introductionHeader = "Complete Installation"; 37 private final static String introductionMessage = "It's now time to complete the installation by copying the codebase to the webcontainer.\n\nPlease press finish to complete the installation."; 38 39 private JTextArea errorMessage = null; 40 41 private int xPosLabels = 10; 42 private int xPosLabelsWidth = 130; 43 private int xPosValues = 150; 44 private int xPosValuesWidth = 260; 45 46 47 public FinishDialog(InfoGlueInstaller infoGlueInstaller) 48 { 49 this.infoGlueInstaller = infoGlueInstaller; 50 51 this.setSize(450, 350); 52 this.setLayout(null); 53 this.setBackground(Color.white); 54 JLabel introductionLabel = new JLabel(introductionHeader); 55 introductionLabel.setBounds(0, 0, 400, 30); 56 introductionLabel.setFont(new java.awt.Font ("Dialog", java.awt.Font.BOLD, 16)); 57 58 JTextArea textArea = new JTextArea(introductionMessage); 59 textArea.setEditable(false); 60 textArea.setBounds(0, 30, 400, 200); 61 textArea.setWrapStyleWord(true); 62 textArea.setLineWrap(true); 63 64 this.errorMessage = new JTextArea(""); 65 this.errorMessage.setForeground(Color.red); 66 this.errorMessage.setEditable(false); 67 this.errorMessage.setBounds(xPosLabels, 240, 320, 50); 68 this.errorMessage.setWrapStyleWord(true); 69 this.errorMessage.setLineWrap(true); 70 71 this.add(introductionLabel); 72 this.add(textArea); 73 74 this.add(errorMessage); 75 76 infoGlueInstaller.setBackButtonCommand("ShowServerDialog"); 77 infoGlueInstaller.setNextButtonCommand("ShowDoneDialog"); 78 infoGlueInstaller.setNextButtonLabel("Finish"); 79 } 80 81 82 public void setErrorMessage(String errorMessage) 83 { 84 this.errorMessage.setText("An error made the installation stop: \n" + errorMessage); 85 } 86 87 public void paint(Graphics g) 88 { 89 Graphics2D g2 = (Graphics2D)g; 90 g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); 91 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 92 93 super.paint(g); 94 } 95 96 } | Popular Tags |