你首先将JFrame frame 通过参数的形式传到你处理的类
假设你的frame下应该有
JEditorPane jEditorPane1=new JEditorPane();
然后你在需要
System.out.println("...");输出信息的地方换成
frame.jEditorPane1.setText(frame.jEditorPane1.getText()+"\n"+"....");
假设你的frame下应该有
JEditorPane jEditorPane1=new JEditorPane();
然后你在需要
System.out.println("...");输出信息的地方换成
frame.jEditorPane1.setText(frame.jEditorPane1.getText()+"\n"+"....");
我能把它包装起来,但我想不同怎么定向??
请指教,谢谢。
另外如果你的程序涉及到多线程的话,有可能会稍稍复杂一点,取决于具体的情况。
还是你自己想吧:)有问题再大家讨论好了。
read
public void read(InputStream in,
Object desc)
throws IOExceptionThis method initializes from a stream. If the kit is set to be of type HTMLEditorKit, and the desc parameter is an HTMLDocument, then it invokes the HTMLEditorKit to initiate the read. Otherwise it calls the superclass method which loads the model as plain text. Parameters:
in - the stream from which to read
desc - an object describing the stream
Throws:
IOException - as thrown by the stream being used to initialize
See Also:
JTextComponent.read(java.io.Reader, java.lang.Object), JTextComponent.setDocument(javax.swing.text.Document)
好处是你可以多了解点东西 :0