JavaÎļþ²Ù×÷´óÈ«£¨¾Å£©
61.Îļþ¼ÐÒÆ¶¯µ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser("ÇëÑ¡ÔñԴ·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°
·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%1 = Jfc.getSelectedFile().getParent();
Jfc = new JFileChooser("ÇëÑ¡ÔñÄ¿±ê·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%2 = Jfc.getSelectedFile().getParent();
62.Ŀ¼ÏÂËùÓÐÎļþ¼Ð¸´ÖƵ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser("ÇëÑ¡ÔñԴ·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°
·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%1 = Jfc.getSelectedFile().getParent();
Jfc = new JFileChooser("ÇëÑ¡ÔñÄ¿±ê·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%2 = Jfc.getSelectedFile().getParent();
63.Ŀ¼ÏÂËùÓÐÎļþ¼ÐÒÆ¶¯µ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser("ÇëÑ¡ÔñԴ·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°
·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%1 = Jfc.getSelectedFile().getParent();
Jfc = new JFileChooser("ÇëÑ¡ÔñÄ¿±ê·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%2 = Jfc.getSelectedFile().getParent();
64.Ŀ¼ÏÂËùÓÐÎļþ¸´ÖƵ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser
Ïà¹ØÎĵµ£º
1.Duplicated Code ´úÂëÖØ¸´¼¸ºõÊÇ×î³£¼ûµÄÒìζÁË¡£ËûÒ²ÊÇRefactoringµÄÖ÷ҪĿ±êÖ®Ò»¡£´úÂëÖØ¸´ÍùÍùÀ´×ÔÓÚcopy-and-pasteµÄ±à³Ì·ç¸ñ¡£ÓëËûÏà¶ÔÓ¦OAOOÊÇÒ»¸öºÃϵͳµÄÖØÒª±êÖ¾¡£ 2.Long method ËüÊÇ´«Í³½á¹¹»¯µÄ“ÒŶ¾”¡£Ò»¸ö·½·¨Ó¦µ±¾ßÓÐ×ÔÎÒ¶ÀÁ¢µÄÒâͼ£¬²»Òª°Ñ¼¸¸öÒâͼ·ÅÔÚÒ»Æð¡£ 3.Large Class ´óÀà¾ÍÊÇÄã°ÑÌ«¶ ......
´´½¨Ò»¸öÎļþtemp£¬Í¬Ê±ÔÚtemp Ŀ¼Ï´´½¨Ò»¸öoutpath.xls
д²Ù×÷
package com;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import jxl.Workbook;
import jxl.format.UnderlineStyle;
import jxl.write.DateTime;
import jxl.write.Label;
import jxl.write.Number ......
45.ÑéÖ¤Schema
//import java.io.*;
//import javax.xml.parsers.*;
//import org.xml.sax.*;
//import org.w3c.dom.*;
String xsdFileName = \"Q:\\\\_dev_stu\\\\xsdtest\\\\src\\\\note.xsd\";
try {
//´´½¨Ä¬ÈϵÄXML´íÎó´¦ÀíÆ÷
XMLErrorHan ......
XMLÎļþʱºÜ¶àÏîÄ¿¾³£Ê¹ÓõÄÅäÖûòÕ߯äËûÓÃ;µÄÎļþ¸ñʽ£¬½âÎöxmlÎļþ¸ñʽµÄ¿ª·¢°üÒ²ºÜ¶à£¬±¾ÎÄÖ÷ҪʹÓÃjava×Ô´øµÄDOM½âÎö°ü¡£±¾ÎÄÒÔÒ»¸öʵ¼ÊÀý×ÓÀ´½²Êö½âÎöxmlÎļþµÄ¹ý³Ì¡£
Ä¿±ê£º½âÎöÕâÑùÒ»¸öXMLÎļþ
employees.xml
=======ÄÚÈÝ¿ªÊ¼========
<?xml version="1.0" encoding="UTF-8"?>
&l ......