JTextArea 最大容量 rt,JTextArea 最大容量是多少? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 JFileChooser fileChooser = new JFileChooser(); fileChooser.setCurrentDirectory(new File(".")); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); int option = fileChooser.showOpenDialog(panel); if (option == JFileChooser.APPROVE_OPTION) { String pathName = fileChooser.getSelectedFile().getAbsolutePath(); panel.setFile(new File(pathName)); panel.getListFilesTextAreaCustomer().setText(""); FileInputStream fis = null; try { fis = new FileInputStream(new File(pathName)); byte[] b = new byte[1024]; int i = 0; int length = 0; StringBuffer sb = new StringBuffer(); do { i = fis.read(b); length += i; if (i >= 0) sb.append(new String(b, 0, i)); // panel.getListFilesTextAreaCustomer().append( // new String(b, 0, i)); } while (i != -1); panel.getListFilesTextAreaCustomer().setText(sb.toString()); { System.out.println(length); System.out.println( panel .getListFilesTextAreaCustomer() .getDocument() .getLength()); } } catch (FileNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } finally { if (fis != null) try { fis.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } panel.setTextChanged(false); } } //输出是 6639207 //5000298 带配置文件的java应用程序怎么打包啊 我想随意输出重复的数字,求指教,变量variable如何解决 怎样修改一个JLable中的图片??? java编写的文件存储与读取程序 java可以使用原始套接字吗 求树型结构示例代码 如何编译azureus源码? 问一个弱弱的问题 socket通讯,CPU使用率100%,如何解决 易道模型与JAVA? 如何输出父类的名字 序列化的一点小问题
fileChooser.setCurrentDirectory(new File("."));
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
int option = fileChooser.showOpenDialog(panel);
if (option == JFileChooser.APPROVE_OPTION) {
String pathName = fileChooser.getSelectedFile().getAbsolutePath();
panel.setFile(new File(pathName));
panel.getListFilesTextAreaCustomer().setText("");
FileInputStream fis = null;
try {
fis = new FileInputStream(new File(pathName));
byte[] b = new byte[1024];
int i = 0;
int length = 0;
StringBuffer sb = new StringBuffer();
do {
i = fis.read(b);
length += i;
if (i >= 0)
sb.append(new String(b, 0, i));
// panel.getListFilesTextAreaCustomer().append(
// new String(b, 0, i));
} while (i != -1);
panel.getListFilesTextAreaCustomer().setText(sb.toString());
{
System.out.println(length);
System.out.println(
panel
.getListFilesTextAreaCustomer()
.getDocument()
.getLength());
}
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} finally {
if (fis != null)
try {
fis.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
panel.setTextChanged(false);
}
} //输出是 6639207
//5000298