javaʱ¼ä¶¯Ì¬ÏÔʾ Á½ÖÖ·½·¨
ʱ¼ä¶¯Ì¬ÏÔʾ
1.·½·¨Ò» ÓÃTimerTask
ÀûÓÃjava.util.TimerºÍjava.util.TimerTaskÀ´×ö¶¯Ì¬¸üУ¬±Ï¾¹Ã¿´Î¸üпÉÒÔ¿´×÷ÊǼÆʱ1Ãë·¢ÉúÒ»´Î¡£
´úÂëÈçÏ£º
import java.awt.Dimension;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
* This class is a simple JFrame implementation to explain how to
* display time dynamically on the JSwing-based interface.
* @author Edison
*
*/
public class TimeFrame extends JFrame
{
/*
* Variables
*/
private JPanel timePanel;
private JLabel timeLabel;
private JLabel displayArea;
private String DEFAULT_TIME_FORMAT = "HH:mm:ss";
private String time;
private int ONE_SECOND = 1000;
public TimeFrame()
{
timePanel = new JPanel();
timeLabel = new JLabel("CurrentTime: ");
displayArea = new JLabel();
configTimeArea();
timePanel.add(timeLabel);
timePanel.add(displayArea);
this.add(timePanel);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setSize(new Dimension(200,70));
this.setLocationRelativeTo(null);
}
/**
* This method creates a timer task to update the time per second
*/
private void configTimeArea() {
Timer tmr = new Timer();
tmr.scheduleAtFixedRate(new JLabelTimerTask(),new Date(), ONE_SECOND);
}
/**
* Timer task to update the time display area
*
*/
protected class JLabelTimerTask extends TimerTask{
SimpleDateFormat dateFormatter = new SimpleDateFormat(DEFAULT_TIME_FORMAT);
@Override
public void run() {
time = da
Ïà¹ØÎĵµ£º
̸̸»Øµ÷°É£¬ÒÔǰѧjavaµÄʱºò¾ÓȻû½Ó´¥µ½Õâ¸ö´Ê»ã£¬º¹£¬×î½üÑо¿hibernateºÍspring½áºÏʱ£¬·¢ÏÖspringʵÏÖhibernateʱӦÓÃÁ˻ص÷»úÖÆ£¬ÓÚÊÇgoogleÁ˺ܶà´Î£¬ÖÕÓÚÓÐËùÌå»áÁË£¬ÏÖÔÚ×öÏÂССµÄ×ܽᣬÒÔ±ã¼ÓÉîÓ¡Ïó£¡
java»Øµ÷»úÖÆ£º
Èí¼þÄ£¿éÖ®¼ä×ÜÊÇ´æÔÚ×ÅÒ»¶¨µÄ½Ó¿Ú£¬´Óµ÷Ó÷½Ê½ÉÏ£¬¿ÉÒÔ°ÑËûÃÇ·ÖΪÈý ......
ÔÚJava AplicationÖÐʵÏֵļòÒײ¥·ÅÆ÷¡£À´Ô´ÓÚºúÇɶàÖ÷±àµÄ¡¶Java³ÌÐòÉè¼Æ°¸Àý½Ì³Ì¡·
ÎÒÊÔÔËÐйýÁË£¬ÆäÖÐµÄ “Ìýº£.wav”,“Ò»¶¨Òª°®Äã.wav”ÒôƵÎļþÒª·ÅÔÚclassËùÔÚµÄÎļþ¼ÐÖУ¬ÇÒÖ»Ö§³Öwav¸ñʽ
Ô´´úÂ룺
import java.applet.Applet;
import java.applet.AudioClip;
import javax.swing.* ......
¡¶javaÓïÑÔ³ÌÐòÉè¼Æ£¨Ò»£©¡·2009Äê×Ôѧ¿¼ÊÔ´ó¸ÙµÚ6ÕÂ
www.wesiedu.com 2009-5-5 ÔÚÏßÄ£Ä⿼³¡
µÚ6Õ ͼÐνçÃæÉè¼Æ(¶þ)
(Ò»)¿Î³ÌÄÚÈÝ
6.1Ñ¡Ôñ¿òºÍµ¥Ñ¡°´Å¥
6.1.1Ñ¡Ôñ¿ò
6.1.2µ¥Ñ¡¿ò
6.1.3µ¥Ñ¡°´Å¥
6.1.4Ñ¡ÔñÏîĿʼþ´¦Àí
6.2ÁбíºÍ×éºÏ¿ò
6.2.1Áбí
6.2.2×éºÏ¿ò
6.3²Ëµ¥
6.3.1²Ëµ¥Ìõ¡ ......
µÚ9Õ ÊäÈëºÍÊä³öÁ÷
(Ò»)¿Î³ÌÄÚÈÝ
9.1×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷
9.1.1 File¶ÔÏó
9.1.2Á÷¶ÔÏó
9.2»º³åʽÊäÈëÊä³ö
9.2.1»º³åʽÊäÈë
9.2.2»º³åʽÊä³ö
9.3Ëæ»ú·ÃÎÊ
9.4Îļþ¶Ô»°¿ò
(¶þ)ѧϰĿµÄÓëÒªÇó
±¾Õ½éÉÜJava³ÌÐòÊý¾ÝÎļþµÄÊäÈëÊä³ö¼¼Êõ¡£ÒªÇóÄܱàд¼òµ¥µÄJavaÎļþ´¦Àí³ÌÐò¡£
(Èý)¿¼ºË֪ʶµãÓ뿼ºËÒªÇó
1.´´½¨File¶ÔÏó£ ......
µÚ10Õ ÍøÂçÓëÊý¾Ý¿â±à³Ì»ù´¡
(Ò»)¿Î³ÌÄÚÈÝ
10.1 JavaÍøÂç±à³Ì»ù´¡
10.1.1 IPµØÖ·ºÍInetAddressÀà
10.1.2ͳһ×ÊÔ´¶¨Î»·ûURL
10.1.3¿Í»§»ú/·þÎñÆ÷ģʽ
l0.2 JavaÊý¾Ý¿â±à³Ì»ù´¡
10.2.1 Java³ÌÐòÓëÊý¾Ý¿âÁ¬½Ó
10.2.2¼¸¸öÖØÒªµÄÀàºÍ½Ó¿Ú
10.2.3Êý¾Ý¿â²éѯ
10.2.4Êý¾Ý¿â¸üÐÂ
(¶þ)ѧϰĿµÄÓëÒªÇó
±¾Õ½éÉÜJavaÍøÂç± ......