javaÓï·¨ÎÊÌâ - Java / Java EE
import java.io.*;
class FileTest
{
public static void main(String [] args) throws Exception
{
File fDir=new File(File.separator);
String strFile="javaÔ´´úÂë²âÊÔ"+File.separator+"java2»ù´¡ÖªÊ¶";
File f = new File(fDir,strFile);
String [] names=f.list(new FilenameFilter()
{
public boolean accept(File dir,String name)
{
if(true)
return name.indexOf(".java")!=-1;
}
});
for (int i=0;i<names.length;i++)
System.out.println(names[i]);
}
}
ΪʲôÕâÌõÓï¾ä±àÒ벻ͨ¹ýÄØ£¿
public boolean accept(File dir,String name)
Àï±ß£¬Èç¹ûif²»³ÉÁ¢¡£·µ»Øʲô£¿ÐèÒª¸ø³ö¡£²»È»±àÒëÆ÷²»ÈÃͨ¹ý
Äã²»Èç°Ñif(true) ¸øÈ¥ÁËËãÁË£¬·´Õý¶¼ÊÇtrueÁË
Â¥ÉÏÁ½Î»ËµµÄÕýÈ·¡£°Ñif£¨true£©È¥µô¾Í¿ÉÒÔÁË¡£
ËäÈ»if(true)ºã±»Ö´ÐУ¬µ«ÊDZàÒëÆ÷»¹ÊÇ»áÅÌif²»³ÉÁ¢µÄÇé¿ö£¬Èç¹ûif²»³ÉÁ¢£¬¾ÍûÓзµ»ØÖµ£¬ËùÓбàÒë²»¹ýÁËŶ
String [] names=f.list(new FilenameFilter() {
public boolean accept(File dir,String name) {
if(true)
return name.indexOf(".java")!=-1;
}
}
);
Õâ¾äÊÇʲôÒâ˼°¡£¿
Õý½â
Ïà¹ØÎÊ´ð£º
<%@page language="java" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="wang.connectDB"/>
< ......
ÎÒÔÚeclipseÖÐдÁËÒ»¸ö²¥·ÅÒôÀÖµÄÀ࣬²¢°ÑÒôÀÖÎļþºÍÀàÎļþ·ÅÔÚÁËÒ»Æ𣬽á¹ûÔËÐÐʱ£¬³öÏÖ´íÎó£¬ËµÊÇÒôÀÖÎļþÄǸöÊǿյģ¬µ«ÊÇÔÚjcreatorÓÃͬÑùµÄ·½·¨½á¹ûÊÇ¿ÉÒÔÔËÐеģ¬ÇëÇó¸ß˵ָ½Ì£¬¸æËßΪʲô£¿¼±
ÄãÈôÊÇÔÚWindo ......
ÎÒ¸Õ×öjava.Óкܶà¸ÅÄîÐԵĶ«Î÷²»ÊǺÜÇå³þ¡£²»ÒªÐ¦ÎÒ°¡¡£
ÕâÁ½ÌìÓиö¹«Ë¾ËµÏȸøÎÒ¸ö¶«Î÷×ö×ö¡£ÒªÇóÊÇÕâÑùµÄ
¡¾Ð´Ò»·ÝÐèÇó˵Ã÷£¬¼òµ¥µÄÉè¼Æ˵Ã÷£¬²¢ÇÒ×öÒ»¸ö¼òµ¥µÄ¹¦ÄÜÄ£¿é³öÀ´¡£¡¿
ÐèÇó˵Ã÷ºÍÉè¼Æ˵Ã÷ÎÒÖªµ ......
±ÈÈçÒ»¸öJButton¿Ø¼þ£¬ÈçºÎ°ÑËüµÄÖµ£¨¼ÙÉèΪ1£©´«µ½JTextFieldÉϲ¢ÏÔʾ³öÀ´£¬²¢ÇÒ°ÑJButtonµÄÖµË͸øÒ»¸ö±äÁ¿
£¨ÎÒÖªµÀÒªÓüàÌýÆ÷£¬µ«ÊÇʼþ·¢Éúºó´¦ÀíµÄ·½·¨Ôõôд²»ÖªµÀ£©
Íû¸÷λ´óÏÀÖ¸½Ì£¡
±ÈÈçÒªÐ޸ĵÄJTe ......
¼ÆËã»ú¿ÆѧÓë¼¼Êõ¸öÈ˼òÀú
»ù±¾ÐÅÏ¢
ÐÕ¡¡¡¡Ãû£º ÀîÑ× ÏàƬ£º
ÐÔ¡¡¡¡±ð£ºÄÐ
³öÉúÈÕÆÚ£º1 ......