100个java小例子

源代码在线查看: readdoccontent.java

软件大小: 748 K
上传用户: kzdai22
关键词: java 100
下载地址: 免注册下载 普通下载 VIP

相关代码

				import java.awt.*;
				import java.awt.event.*;
				import java.io.*;
				import javax.swing.*;
				import javax.swing.text.*;
				
				public class ReadDocContent implements Runnable{
				
				    JFrame mainframe;
				    JTextPane textpane = null;
				    JInternalFrame innerframe = null;
				    
				    JFileChooser fileChooser = null;
				    Thread athread;
				    
				    SimpleAttributeSet attrset = new SimpleAttributeSet();
				    
				    public ReadDocContent(JTextPane pane,JFrame mf,JInternalFrame current){
				        
				        this.mainframe  = mf;
				        this.textpane   = pane;
				        this.innerframe = current;
				                               
				        fileChooser = new JFileChooser();
				        
				        athread = new Thread(this);        
				        athread.start();             
				    }//end of ReadDocContent()
				            
				    public void run()    {        
				        File file = null;        
				        int result = fileChooser.showOpenDialog(mainframe);                
				        textpane.setText("");        
				        if (result == JFileChooser.APPROVE_OPTION)        {            
				            file = fileChooser.getSelectedFile();            
				            innerframe.setTitle("眤匡拒			

相关资源