JAVA:ÓöàÏß³ÌʵÏÖʱ¼äµÄ¶¯Ì¬ÏÔʾ
import java.awt.*;
import javax.swing.*;
import java.util.Date;
import java.awt.*;
class Time extends JFrame implements Runnable{//ʵÏÖ½Ó¿Ú
Thread clockThread;
JLabel jLabel=new JLabel();
public Time()
{
Container con=this.getContentPane();
con.add(new Drawtime());
}
public void start(){
//¸Ã·½·¨ÊÇÀàµÄ·½·¨£¬²»ÊÇÏ̵߳ķ½·¨
if(clockThread==null){
clockThread=new Thread(this,"Clock");
/*Ïß³ÌÌåÊÇClock¶ÔÏó±¾Éí£¬Ïß³ÌÃû×ÖΪ"Clock"*/
clockThread.start();//Æô¶¯Ïß³Ì
}
}
public void run(){//run()·½·¨ÖÐÊÇÏß³ÌÖ´ÐеÄÄÚÈÝ
while(clockThread!=null){
repaint();//Ë¢ÐÂÏÔʾ»Ãæ
try{
clockThread.sleep(1000);
//˯Ãß1Ã룬¼´Ã¿¸ô1ÃëÖ´ÐÐÒ»´Î
}
catch(InterruptedException e){}
}
}
public void stop(){
//¸Ã·½·¨ÊÇÀàµÄ·½·¨£¬²»ÊÇÏ̵߳ķ½·¨
clockThread.stop();
clockThread=null;
}
}
public class JFrameDemo
{public static void main(String[] args)
{Time frame=new Time();
frame.setSize(500,300);
frame.setVisible(true); //ÉèÖÃ×é¼þ¿É¼û
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); //¹Ø±ÕÈÝ¿Ú£¬²¢½áÊø³ÌÐòµÄÔËÐÐ
frame.start();
frame.run();
frame.stop();
}
}
class Drawtime extends JPanel
{
public void paint(Graphics g){
g.setColor(Color.red);
Font font1=new Font("»ªÎIJÊÔÆ",Font.ITALIC,60);
g.setFont(font1);
Date now=new Date();//»ñµÃµ±Ç°µÄʱ¼ä¶ÔÏó
g.drawString(now.getHours()+":"+now.getMinutes()+":"+now.getSeconds(),140,140);
//ÏÔʾµ±Ç°Ê±¼ä
}
}
Ïà¹ØÎĵµ£º
̸̸»Øµ÷°É£¬ÒÔǰѧjavaµÄʱºò¾ÓȻû½Ó´¥µ½Õâ¸ö´Ê»ã£¬º¹£¬×î½üÑо¿hibernateºÍspring½áºÏʱ£¬·¢ÏÖspringʵÏÖhibernateʱӦÓÃÁ˻ص÷»úÖÆ£¬ÓÚÊÇgoogleÁ˺ܶà´Î£¬ÖÕÓÚÓÐËùÌå»áÁË£¬ÏÖÔÚ×öÏÂССµÄ×ܽᣬÒÔ±ã¼ÓÉîÓ¡Ïó£¡
java»Øµ÷»úÖÆ£º
Èí¼þÄ£¿éÖ®¼ä×ÜÊÇ´æÔÚ×ÅÒ»¶¨µÄ½Ó¿Ú£¬´Óµ÷Ó÷½Ê½ÉÏ£¬¿ÉÒÔ°ÑËûÃÇ·ÖΪÈý ......
°²×°Java¿ª·¢Èí¼þʱ£¬Ä¬ÈÏ°²×°°üº¬Á½¸öÎļþ¼Ð£¬Ò»¸öJDK(Java¿ª·¢¹¤¾ßÏä)£¬Ò»¸öJRE(JavaÔËÐл·¾³£¬ÄÚº¬JVM)£¬ÆäÖÐJDKÄÚÁíº¬Ò»¸öJRE¡£Èç¹ûÖ»ÊÇÔËÐÐJava³ÌÐò£¬ÔòJREÒÑ×ã¹»£»¶øJDKÔòÖ»Óпª·¢ÈËÔ±²ÅÓõ½¡£
Ò»¡¢JVMÄÚ´æ·ÖÅäÉèÖÃ
1. JVMÄÚ´æ·ÖÅäÉèÖõIJÎÊýÓÐËĸö£º
-Xmx Java Heap×î´óÖµ£¬Ä¬ÈÏֵΪÎïÀíÄÚ´æµÄ ......
µÚ5ÕÂͼÐνçÃæÉè¼Æ(Ò»)
(Ò»)¿Î³ÌÄÚÈÝ
5.1 ͼÐνçÃæÉè¼Æ»ù´¡
5.1.1 AWI’ºÍSwing
5.1.2×é¼þºÍÈÝÆ÷
5.1.3ʼþÇý¶¯³ÌÐòÉè¼Æ»ù´¡
5.2¿ò¼Ü´°¿Ú .
5.3±êÇ©¡¢°´Å¥ºÍ°´Å¥Ê¼þ
5.3.1 ±êÇ©
5.3.2°´Å¥ºÍ°´Å¥Ê¼þ´¦Àí
5.4Ãæ°å
5.4.1 JPanel
5.4.2 JScrollPane
5.5²¼¾ÖÉè¼Æ
5.5.1 FlowI.ayout²¼¾Ö
5.5.2 BorderI.a ......
1£®JavaµÄ¼òµ¥ÀàÐͼ°Æä·â×°Æ÷Àà
¢ÅJava¼òµ¥ÀàÐÍÓë·â×°Àà
ÎÒÃÇÖªµÀ,JavaÓïÑÔÊǵäÐ͵ÄÖ§³ÖÃæÏò¶ÔÏóµÄ³ÌÐòÓïÑÔ,µ«¿¼Âǵ½ÓÐЩ»ù±¾Êý¾ÝÀàÐ͵Ľṹ¼òµ¥,Õ¼ÄÚ´æСÇÒ´æÈ¡ËٶȿìµÈÓŵã,JavaÒÀÈ»ÌṩÁ˶ÔÕâЩ·ÇÃæÏò¶ÔÏóµÄ¼òµ¥Êý¾ÝÀàÐ͵ÄÖ§³Ö¡£µ±È»,JavaÔÚÌṩ´óÁ¿µÄÆäËüÀàʱ,Ò²ÌṩÁËÓë¼òµ¥Êý¾ÝÀàÐͶÔÓ¦µÄ·â×°Àà,ÓÚÊÇ,JavaÖ ......
´úÂëÈçÏ£º
1 String command = " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
2 try {
3 Process process& ......