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
Ïà¹ØÎĵµ£º
×Ô¶¯×°ÏäÓë²ðÏäµÄ¹¦ÄÜÊÂʵÉÏÊDZàÒëÆ÷À´°ïÄúµÄ棬±àÒëÆ÷ÔÚ±àÒëʱÆÚÒÀÄúËù±àдµÄÓï·¨£¬¾ö¶¨ÊÇ·ñ½øÐÐ×°Ïä»ò²ðÏ䶯×÷¡£ÀýÈ磺
Integer i = 100.Ï൱ÓÚ±àÒëÆ÷×Ô¶¯ÎªÄú×÷ÒÔϵÄÓï·¨±àÒ룺
Integer i = new Integer(100).ËùÒÔ×Ô¶¯×°ÏäÓë²ðÏäµÄ¹¦ÄÜÊÇËùνµÄ“±àÒëÆ÷ÃÛÌÇ”(Compiler Sugar)£¬ËäȻʹÓÃÕâ¸ö¹¦Äܷܺ½±ã£¬µ ......
¶ÔÓÚ Java 1.2£¬ÄúÖ»ÐèÓÃ
Authenticator.setDefault() °²×°Ò»¸ö Authenticator¡£ÕâÑù£¬µ±ÐèÒªÈÏ֤ʱ£¬ÒѰ²×°µÄ Authenticator µÄ
getPasswordAuthentication() ·½·¨¾Í»á±»µ÷Óã¬È»ºóÄú¾Í¿ÉÒÔÓÃÊʵ±µÄÓû§ÃûºÍ¿ÚÁîÀ´ÉèÖà PasswordAuthentication ʵÀý¡£¾ÍÕâô¼òµ¥¡£
package
cn.arthurs.web;
import ja ......
import java.io.*;
import java.math.*;
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner cin=new Scanner(System.in);
BigDecimal a; ......
ÓÃÁËÁ½Ììʱ¼äѧϰÁËÏÂFlexºÍjavaÅäºÏʵÏÖÎļþÉÏ´«£¬ÕÒÁ˸öСÀý×Ó¡£Ç°¶Ëµ±È»ÊÇflex£¬ºǫ́ʹÓÃservlet£¬°Ñ´úÂëÌùÉÏÀ´£¬±¸Íü°É£º
FileUpload.java:
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletExc ......
XMLÎļþʱºÜ¶àÏîÄ¿¾³£Ê¹ÓõÄÅäÖûòÕ߯äËûÓÃ;µÄÎļþ¸ñʽ£¬½âÎöxmlÎļþ¸ñʽµÄ¿ª·¢°üÒ²ºÜ¶à£¬±¾ÎÄÖ÷ҪʹÓÃjava×Ô´øµÄDOM½âÎö°ü¡£±¾ÎÄÒÔÒ»¸öʵ¼ÊÀý×ÓÀ´½²Êö½âÎöxmlÎļþµÄ¹ý³Ì¡£
Ä¿±ê£º½âÎöÕâÑùÒ»¸öXMLÎļþ
employees.xml
=======ÄÚÈÝ¿ªÊ¼========
<?xml version="1.0" encoding="UTF-8"?>
&l ......