java:Applet²¼¾ÖÎÊÌâ,ÈçºÎÌí¼Ó°´Å¥£¬±êÇ©ÎÊÌâ×ܽá
½ñÌìѧϰÁËapplet²¼¾ÖÎÊÌ⣺
°´Å¥¡¢±êÇ©ÊÇÔõÑù¼ÓÈëµ½applet³ÌÐò(ÈÝÆ÷)µ±ÖÐÈ¥µÄÄØ£¿
ÐèÒªÓõ½²¼¾ÖÈÝÆ÷¹ÜÀíÆ÷(LayoutManager)£ºËüÓÃÓÚÐÖúÈÝÆ÷È·¶¨¼ÓÈëµÄ×é¼þ(°´Å¥µÈ)Ó¦¸Ã·ÅÖõÄλÖÃ
awtÌṩÁË4Öг£ÓõIJ¼¾ÖÈÝÆ÷¹ÜÀíÆ÷
>>FlowLayout
>>BorderLayout
>>GridLayout
>>CardLayout
appletĬÈÏʹÓÃFlowLayout,appletʹÓÃÈÝÆ÷¹ÜÀíÆ÷µÄ·½·¨ÈçÏ£º
setLayout (new BorderLayout)
setLayout()·½·¨ÊÇappletÀà¼Ì³ÐContainerÀàÖеķ½·¨¶øÀ´£¬Òò´ËÔÚapplet³ÌÐòÖпÉÒÔÖ±½Óµ÷ÓÃ
applet¼ÓÈë°´Å¥Ò»¶¨ÐèÒªÉÏÃæµÄÈÝÆ÷¹ÜÀíÆ÷ô£¿
²»Ò»¶¨£¬¿ÉÒÔÏÈ setLayout(null); È»ºó×Ô¼ºÈ·¶¨×é¼þ·ÅÖõÄϸ½Ú£¬´úÂëÂé·³¡£
Èç¹ûÄã²»Óò¼¾Ö¹ÜÀíÆ÷£¨JframeÖеÄÓ÷¨£©£º
JButton b1 = new JButton("hello");
getContentPane().add(b1);
b1.setLocation(100,10);
ÒÔÏÂÊÇÈÝÆ÷¹ÜÀíÆ÷³£ÓõÄ4ÖÖ²¼¾Öд·¨
=================================================
applet ʹÓà FlowLayout ²¼¾Ö£º
Ö¸¶¨²¼¾Ö:setLayout(new FlowLayout())
¼ÓÈë×é¼þ£ºadd(×é¼þʵÀý)
×÷ÓãºÓÉ×óµ½ÓÒ£¬ÓÉÉϵ½ÏÂÒÀ´Î·ÅÖÃ×é¼þ
¼ÓÈë×é¼þʹÓÃappletÀà¼Ì³ÐContainerÀàÖеķ½·¨³ÉÔ±add();
=================================================
import java.awt.*;
import java.applet.*;
public class UseFlowLayout extends Applet{
public void init()
{
setLayout(new FlowLayout()); //ÒòΪÊÇĬÈϹÜÀíÆ÷£¬¿ÉÒÔÊ¡ÂÔ
//setLayout()·½·¨ÊÇappletÀà¼Ì³ÐContainerÀàÖеķ½·¨¶øÀ´£¬Òò´ËÔÚapplet³ÌÐòÖпÉÒÔÖ±½Óµ÷ÓÃ
for(int i = 0; i<5;i++){
add(new Button("°´Å¥" + i )); //¼ÓÈë5¸ö°´Å¥
//appletÀà¼Ì³ÐContainerÀàÖеķ½·¨³ÉÔ±add();
}
}
}
==================================================
appletʹÓÃBorderLayout();
Ö¸¶¨²¼¾Ö£ºsetLayout(new BorderLayout());
¼ÓÈë×é¼þ£ºadd(×é¼þʵÀý,λÖó£Á¿)
×÷Ó㺴ËÖÖ²¼¾Ö½«ÈÝÆ÷»®·ÖΪ5¸öÇøÓò£¬·Ö±ðÊÇÉÏ¡¢Ï¡¢×ó¡¢ÓÒ¡¢ÖÐ
[λÖó£Á¿]Ö¸¶¨ÁË×é¼þ½«Òª·ÅÖõ
Ïà¹ØÎĵµ£º
JXL(Java Excel API)ÊÇÒ»¸öÓÃÀ´¶¯Ì¬¶ÁдExcelÎļþµÄ¿ªÔ´¿ò¼Ü£¬ÀûÓÃËü¿ÉÒÔÔÚÈκÎÖ§³ÖJavaµÄ²Ù×÷ϵͳÉ϶¯Ì¬¶ÁдExcelÎļþ¡£JXLµÄÖ÷Ò³ÊÇ£ºhttp://www.andykhan.com/jexcelapi/£¬¿ÉÒÔÔÚÕâÀïÏÂÔص½ËüµÄ×îеİ汾¡£
Äã¿ÉÒÔ·Ö±ðͨ¹ýÈçÏÂÃüÁî
java -jar jxl.jar -xml test.xls
java -jar jxl.jar -cvs test.xls
ÒÔxml ......
Ò»¸ö¼òµ¥µÄË«»÷¾ÍÄÜÔËÐÐjarÎļþµÄ´ò°ü¹ý³Ì:
http://blog.csdn.net/ihc523/archive/2009/10/11/4636832.aspx
eclipseµ¼³öjarÎļþÔÙ½«Ëüת»»³Éexe¿ÉÖ´ÐÐÎļþ:
http://hi.baidu.com/%C4%CF%BA%BD%CC%EC%CF%C2/blog/item/1601a381ac9af9d1bd3e1e3d.html
´òJar°üµÄÒ»¸öEclipse²å¼þFatJar:
http://blog.csdn.net/lqsmn613/ar ......
¹ØÓÚ Java Concurrency
×Ô´ÓJavaµ®Éú֮ʱ£¬Java ¾ÍÖ§³Ö²¢ÐеĸÅÄ±ÈÈçÏ̺߳ÍËø»úÖÆ¡£Õâ¸ö½Ì³Ì°ïÖú¿ª·¢¶àÏß³ÌJava³ÌÐòÔ±Äܹ»Àí½âºËÐĵÄJava²¢ÐÐÀíÄîÒÔ¼°ÈçºÎʹÓÃËûÃÇ¡£ ÄÚÈÝÉæ¼°µ½JavaÓïÑÔÖеÄỊ̈߳¬ ÖØÁ·¼¶ÒÔ¼°ÇáÁ¿¼¶Í¬²½»úÖÆ ÒÔ¼°JavaSE 5 ÖеÄËø£¬Ô×ÓÁ¿ ²¢ÐÐÈÝÆ÷£¬Ï̵߳÷¶È ÒÔ¼°Ïß³ÌÖ´ÐÐÕß ......
Ò»¸öÈí¼þÉè¼ÆµÄºÃ»µ£¬ÎÒÏëºÜ´ó³Ì¶ÈÉÏÈ¡¾öÓÚËüµÄÕûÌå¼Ü¹¹£¬¶øÕâ¸öÕûÌå¼Ü¹¹Æäʵ¾ÍÊÇÄã¶ÔÕû¸öºê¹ÛÉÌÒµÒµÎñµÄ³éÏó¿ò¼Ü£¬µ±´ú±íÒµÎñÂß¼µÄ¸ß²ã³éÏó²ã½á¹¹ ºÏÀíʱ£¬Äãµ×²ãµÄ¾ßÌåʵÏÖÐèÒª¿¼Âǵľͽö½öÊÇһЩËã·¨ºÍһЩ¾ßÌåµÄÒµÎñʵÏÖÁË¡£µ±ÄãÐèÒªÔÙ¿ª·¢ÁíÒ»¸öÏà½üµÄÏîĿʱ£¬ÄãÒÔÇ°µÄ³éÏó²ã˵²»¶¨»¹¿ÉÒÔÔÙ´ÎÀûÓà ÄØ£¬Ãæ¶Ô¶ÔÏóµÄÉè¼Æ ......
»ñµÃmysqlºÍoracleÁ´½ÓµÄÀà
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectDB {
private static final String MYSQL = "jdbc:mysql://";
private static final String ORACLE = "jdbc:oracle:thin:@";
private ConnectD ......