1 24 25 package org.objectweb.cjdbc.console.wizard; 26 27 import java.awt.Color ; 28 import java.awt.HeadlessException ; 29 import java.io.IOException ; 30 31 import javax.swing.JFrame ; 32 import javax.swing.JTextArea ; 33 34 import org.objectweb.cjdbc.common.i18n.WizardTranslate; 35 import org.objectweb.cjdbc.console.gui.constants.GuiConstants; 36 import org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter; 37 38 44 public class XmlValidatorFrame extends JFrame 45 { 46 47 final String eol = System.getProperty("line.separator"); 48 JTextArea report; 49 JTextAreaWriter writer; 50 51 57 public XmlValidatorFrame(String fileName) throws HeadlessException 58 { 59 super(WizardTranslate.get("init.validator.frame")); 60 GuiConstants.centerComponent(this, WizardConstants.VALIDATOR_WIDTH, 61 WizardConstants.VALIDATOR_HEIGHT); 62 this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 63 report = new JTextArea (); 64 writer = new JTextAreaWriter(report); 65 report.setForeground(new Color (9498256)); 66 this.getContentPane().add(report); 67 this.pack(); 68 this.setVisible(true); 69 writeLine(WizardTranslate.get("init.validator.echo", fileName)); 70 } 71 72 77 public void writeLine(String s) 78 { 79 try 80 { 81 writer.write(s + eol); 82 writer.flush(); 83 report.repaint(); 84 } 85 catch (IOException e) 86 { 87 e.printStackTrace(); 88 } 89 } 90 91 94 public void setWarning() 95 { 96 report.setForeground(new Color (16758465)); 97 } 98 99 } | Popular Tags |