JAVA³ÌÐòÈ«¾Ö¼üÅ̼àÌýʼþ
// ×¢²áÓ¦ÓóÌÐòÈ«¾Ö¼üÅÌʼþ, ËùÓеļüÅÌʼþ¶¼»á±»´Ëʼþ¼àÌýÆ÷´¦Àí.
Toolkit tk = Toolkit.getDefaultToolkit();
tk.addAWTEventListener(new MyAWTEventListener(), AWTEvent.KEY_EVENT_MASK);
class MyAWTEventListener implements AWTEventListener {
private boolean controlPressed = false;
private boolean cPressed = false;
@Override
public void eventDispatched(AWTEvent event) {
if (event.getClass() == KeyEvent.class) {
// ±»´¦ÀíµÄʼþÊǼüÅÌʼþ.
KeyEvent keyEvent = (KeyEvent) event;
if (keyEvent.getID() == KeyEvent.KEY_PRESSED) {
keyPressed(keyEvent);
} else if (keyEvent.getID() == KeyEvent.KEY_RELEASED) {
keyReleased(keyEvent);
}
}
}
private void keyPressed(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.VK_CONTROL) {
controlPressed = true;
} else if (event.getKeyCode() == KeyEvent.VK_C) {
cPressed = true;
}
if (controlPressed && cPressed) {
&nbs
Ïà¹ØÎĵµ£º
ÿ¸öÈ˵Äѧϰ·½·¨ÊDz»Í¬µÄ£¬Ò»¸öÈ˵ķ½·¨²»¼ûµÃÊʺÏÁíÒ»¸öÈË£¬ÎÒÖ»ÄÜÊÇ̸×Ô¼ºµÄѧϰ·½·¨¡£ÒòΪÎÒѧϰJavaÊÇÍêÈ«×ÔѧµÄ£¬´ÓÀ´Ã»ÓÐÎʹý±ðÈË£¬ËùÒÔѧϰµÄ¹ý³Ì»ù±¾ÉÏÍêÈ«ÊÇ×Ô¼ºÃþË÷³öÀ´µÄ¡£ÎÒÒ²²»ÖªµÀÕâÖÖ·½·¨ÊÇ·ñÊDZȽϺõķ½·¨£¬Ö»Äܸø´ó¼ÒÌṩһµã²Î¿¼ÁË¡£
ѧϰJavaµÄµÚÒ»²½ÊÇ°²×°ºÃJDK£¬Ð´Ò»¸öHello World£¬ ÆäʵJ ......
package test;
import java.io.File;
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack ......
´ó¼Ò¶¼ÖªµÀJAVAÖÐʹÓÃOBJECT×÷ΪΨһµÄ»ùÀà¡£µ«ÊÇJAVAµÄÉè¼ÆÕßΪʲôҪÕâÑù×öÄØ£¿ÖضÁ¡¶TTHINKING IN JAVA¡·£¬µÃ³öÒÔÏÂÔÒò£º
1£¬JAVAÊÇ´¿ÃæÏò¶ÔÏóµÄÓïÑÔ¡£µ¥¼Ì³ÐÌåϵ±£Ö¤ÁËËùÓÐн¨µÄ»òJDKÖÐÒÑÓеÄÀ඼±ØÐë¼Ì³Ð×ÔOBJECT¡£ÕâÑù£¬±£Ö¤ÁËËùÓеÄÀ඼¾ßÓÐһЩ»ù±¾µÄ·½·¨¡£ÀýÈçÒ»¸öString¶ÔÏóÓÐtoString()·½·¨£¬ÁíÍâÒ»¸öMath¶ÔÏ ......
Java ʵÏÖµÄÑ¡ÔñÅÅÐò·¨£¬ÏÈÔÚNetbeansÀïµ÷ÊÔÔËÐÐÁËһϣ¬È»ºóÓÖÔÚEclipseÁËÔËÐÐÁËһϡ£
public class ArraySort {
public static void main(String[] args) {
int Arrays[]={50,45,2,678,90,40,};
int i,j,temp,min;
int len=Array ......
package com.huawei.globe;
import java.util.zip.*;
import java.io.*;
public class Compress {
public Compress() {
}
// ѹËõĿ¼ÏµÄÎļþ
public void compress(String zipFileName, String inputFile) throws Exception {
compress(zipFileName, new File(inputFile));
......