标签:
import java.awt.BorderLayout;
import java.awt.Color;
import java.io.File;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class FileUtils {
/**
String[] itme = {".gif",".bmp"};
JComboBox frm=new JComboBox(itme);
frm.setEnabled(true);
frm.setEditable(true);
frm.setMaximumRowCount(5);
frm.setBounds(230,30,130,25);
frame.setBounds(300,200,350,300);
frame.setVisible(true);
JTextArea main_text =new JTextArea();
main_text.setBackground(Color.white);
JScrollPane z=new JScrollPane();
z.setViewportView(main_text);
main_text.setEnabled(false);
main_panel.add(frm,BorderLayout.NORTH);
main_panel.add(z,BorderLayout.CENTER);
frame.add(main_panel);
try {
String str = FileUtils.listDirectory(new File("D:\FileUtils"));
main_text.setText(str);
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
标签:
原文地址:http://www.cnblogs.com/5akt/p/5399578.html