javaʱ¼ä¸ñʽ´óÈ«
import java.text.*;
import java.util.Calendar;
public class VeDate {
/**
* »ñÈ¡ÏÖÔÚʱ¼ä
*
* @return ·µ»Øʱ¼äÀàÐÍ yyyy-MM-dd HH:mm:ss
*/
public static Date getNowDate() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(currentTime);
ParsePosition pos = new ParsePosition(8);
Date currentTime_2 = formatter.parse(dateString, pos);
return currentTime_2;
}
/**
* »ñÈ¡ÏÖÔÚʱ¼ä
*
* @return·µ»Ø¶Ìʱ¼ä¸ñʽ yyyy-MM-dd
*/
public static Date getNowDateShort() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(currentTime);
ParsePosition pos = new ParsePosition(8);
Date currentTime_2 = formatter.parse(dateString, pos);
return currentTime_2;
}
/**
* »ñÈ¡ÏÖÔÚʱ¼ä
*
* @return·µ»Ø×Ö·û´®¸ñʽ yyyy-MM-dd HH:mm:ss
*/
public static String getStringDate() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(currentTime);
return dateString;
}
/**
* »ñÈ¡ÏÖÔÚʱ¼ä
*
* @return ·µ»Ø¶Ìʱ¼ä×Ö·û´®¸ñʽyyyy-MM-dd
*/
public static String getStringDateShort() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(currentTime);
return dateString;
}
/**
* »ñȡʱ¼ä Сʱ:·Ö;Ãë HH:mm:ss
*
* @return
Ïà¹ØÎĵµ£º
String ×Ö·û´®³£Á¿
StringBuffer ×Ö·û´®±äÁ¿£¨Ḭ̈߳²È«£©
StringBuilder ×Ö·û´®±äÁ¿£¨·ÇḬ̈߳²È«£©
¼òÒªµÄ˵£¬ String ÀàÐÍºÍ StringBuffer ÀàÐ͵ÄÖ÷ÒªÐÔÄÜÇø±ðÆäʵÔÚÓÚ String ÊDz»¿É±äµÄ¶ÔÏó, Òò´ËÔÚÿ´Î¶Ô String ÀàÐͽøÐиıäµÄʱºòÆäʵ¶¼µÈͬÓÚÉú³ÉÁËÒ»¸öÐ嵀 String ¶ÔÏó£¬È»ºó½«Ö¸ÕëÖ¸ÏòÐ嵀 String ¶ÔÏó£¬ËùÒÔ¾ ......
< type="text/javascript"> document.body.oncopy = function() { if (window.clipboardData) { setTimeout(function() { var text = clipboardData.getData("text"); if (text && text.length>300) { text = text + "\r\n\n±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£º" + location.href; clipboardData.setData( ......
6.·ºÐÍ:
1¡¢·ºÐ͵ÄÀàÐͲÎÊýÖ»ÄÜÊÇÀàÀàÐÍ£¨°üÀ¨×Ô¶¨ÒåÀࣩ£¬²»ÄÜÊǼòµ¥ÀàÐÍ¡£
¡¡¡¡2¡¢Í¬Ò»ÖÖ·ºÐÍ¿ÉÒÔ¶ÔÓ¦¶à¸ö°æ±¾£¨ÒòΪ²ÎÊýÀàÐÍÊDz»È·¶¨µÄ£©£¬²»Í¬°æ±¾µÄ·ºÐÍÀàʵÀýÊDz»¼æÈݵġ£
¡¡¡¡3¡¢·ºÐ͵ÄÀàÐͲÎÊý¿ÉÒÔÓжà¸ö¡£
¡¡¡¡4¡¢·ºÐ͵IJÎÊýÀàÐÍ¿ÉÒÔʹÓÃextendsÓï¾ä£¬ÀýÈç<T extends superclass>¡£Ï°¹ßÉϳÉΪ“Óн ......
package java;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;
public class fontnameDome extends JFrame implements ActionListen ......