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¸öÇøÓò£¬·Ö±ðÊÇÉÏ¡¢Ï¡¢×ó¡¢ÓÒ¡¢ÖÐ
[λÖó£Á¿]Ö¸¶¨ÁË×é¼þ½«Òª·ÅÖ
Ïà¹ØÎĵµ£º
ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔÀí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
private Object data; //ÔªËر¾Éí
private NodeBean next; //ÏÂÒ»¸ö½Úµã
&n ......
À´×Ôhttp://www.ilovematlab.cn/thread-30836-1-1.html
matlab java.lang.OutOfMemoryError
JavaÐéÄâ»úÄÚ´æ²»¹»ÓÃÁË.¿ÉÒÔÔö¼Ó×î´óÄÚ´æÉèÖÃ.
1. ²éÕÒmatlab¸ù·¾¶.ÔÚmatlabÃüÁîÐÐÖÐÇÃÈë:matlabroot
ÏÔʾ¸ù·¾¶,Èç:C:\MATLAB7
2.²é¿´µ±Ç°JavaÐéÄâ»ú×î´ó¶ÑÄÚ´æ, ÇÃÈë:java.lang.Runtime.getRuntime.maxMemory
3.²é¿ ......
Ö÷Ïß³ÌÖУº
InitThread initThread=new InitThread(new Semaphore(0));//³õʼ»¯Ò»¸ö×ÓỊ̈߳¬´«Ò»¸ö³õֵΪ0µÄÐźÅÁ¿¸øËü
Display.getDefault().asyncExec(initThread);
try {//´Ë´¦»á¹ÒÆð£¬Ö±µ½×ÓÏß³ÌÍê³É¹¤×÷£¬ÐÞ¸ÄÁËÐźÅÁ¿µÄÖµ£¬Ö÷Ï̲߳Żá¼ÌÐø
initThread.getSemaphore().acquire();
} catch (Inte ......
³õ¶ÁÕâ±¾Ê飬¸Ð¾õȷʵ²»´í£¬×÷ÕߺÜÓÐʵÁ¦¡£µÚÈýÕÂÌáµ½Èí¼þµÄ¿Éά»¤ÐԺͿɸ´ÓÃÐÔ£¬×÷ÕßÊǽèÖújavaÓïÑԵĻúÖÆ£¬À´½²½âÁËÃæÏò¶ÔÏóÉè¼ÆģʽµÄÖØҪ֪ʶ¡£
Ò»¸öÈí¼þËæ×ÅÐÔÄÜÒªÇóµÄ±ä»¯¶ø±äµÃ“¸¯ÀÔµÄÔÒòÓÐ4¸ö£º¹ýÓÚ½©Ó²£¬¹ýÓÚ´àÈõ£¬¸´ÓÃÂʵͣ¬ð¤¶È¹ý¸ß¡£
½©Ó²£ºÈç¹ûÐèÒª¸øÒ»¸öϵͳÔö¼ÓÒ»¸ö¹¦Ä ......
Web ServiceµÄ·Ï»°¾Í²»ËµÁË¡£¾Í˵ÔõôʹÓðɡ£
1.ÐèÒªjava»·¾³ µ½http:.//java.sun.com/J2SE ¿ÉÒÔÏÂÔØ Java Development Kit
2.ÐèÒªGoogle APIµÄJarÎļþ£¬Googleapi.jar¡£¿ÉÒÔµ½http://www.google.com/apisÏÂÔØ¡£Ìî¼Ó½øCLASSPATH.
3.ÉêÇëGoogle·ÃÎÊÕʺţ¬Ä¿Ç°GoogleÖ§³ÖÃâ·ÑÉêÇëµÄ·½Ê½£¬Óû§ÐèҪʹÓÃÒ»¸öem ......