Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÎÒÓÃÕâ¸ö¿´Ð§¹û£ºÒ»¸ö»ù±¾µÎJava´°¿Ú´ø°´¼ü¼ì²â

Ò»¸öJava´°¿Ú´ø°´¼ü¼ì²â£¨ÅÜJava¿ÉÊÓС³ÌÐòʱÓã©£¬沒¼ÓÐÞÊΣ¬°³×Ô¼ºÓõΡ£
package math;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
/**
* »ù±¾µÄ»æÍ¼´°¿Ú£¬»Ø³µ¹Ø±Õ´°¿Ú
*/
@SuppressWarnings("serial")
public class GraphicTest extends Frame implements KeyListener {
/**
* °´¼ü¼ì²â
*/
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case 10:
System.out.println("I am enter");
System.exit(0);
break;
case 37: // ×ó
break;
case 38: // ÉÏ
break;
case 39: // ÓÒ
break;
case 40: // ÏÂ
break;
}
this.repaint();
}
public void keyTyped(KeyEvent e) {
}
public void keyReleased(KeyEvent e) {
}
public GraphicTest() {
super("Frame-By-Lazybone");
setSize(1000, 800);
this.addKeyListener(this);
this.setVisible(true);
}
int width = 25;
int startX = 50;
int startY = 50;
int count = 25;
/** »æÖÆ·½·¨ **/
public void paint(Graphics g) {
g.setColor(Color.black);
/** »­ÆåÅÌ **/
for (int i = 1; i < count + 1; i++) {
g.drawLine(startX + i * width, width + startX, startX + i * width,
count * width + startY);
}
for (int i = 1; i < count + 1; i++) {
g.drawLine(startX + width, i * width + startY, count * width
+ startX, i * width + startY);
}
}
public static void main(String[] args) {
new GraphicTest();
}
}


Ïà¹ØÎĵµ£º

JavaÒì³£´¦Àí×ܽá


JavaÒì³£´¦Àí×ܽá
 
        Òì³£´¦ÀíÊdzÌÐòÉè¼ÆÖÐÒ»¸ö·Ç³£ÖØÒªµÄ·½Ã棬ҲÊdzÌÐòÉè¼ÆµÄÒ»´óÄѵ㣬´ÓC¿ªÊ¼£¬ÄãÒ²ÐíÒѾ­ÖªµÀÈçºÎÓÃif...else...À´¿ØÖÆÒì³£ÁË£¬Ò²ÐíÊÇ×Ô·¢µÄ£¬È»¶øÕâÖÖ¿ØÖÆÒ쳣ʹ¿à£¬Í¬Ò»¸öÒì³£»òÕß´íÎóÈç¹û¶à¸öµØ·½³öÏÖ£¬ÄÇôÄãÿ¸öµØ·½¶¼Òª×öÏàͬ´¦Àí£¬¸Ð¾õÏ൱ ......

µÚÒ»¸öJava½çÃæ³ÌÐò

     ×öÁËÒ»¸öºÜ¼òµ¥µÄ½çÃæ³ÌÐò,Ò²ÊÇÎÒµÚÒ»¸ö½çÃæ³ÌÐò.Ö÷Òª¹¦ÄܾÍÊÇÊäÈëÁ½¸öÊý×Ö,¼ÆËãÕâÁ½¸öÊý×ֵĺÍ,ºÜ¼òµ¥µÄ¹¦ÄÜ,ÎÒÈ´»¨Á˺ܾÃ,¶ÔjavaÌ«²»ÊìϤÁË,Á¬µÃµ½textField1ÖÐÓû§ÊäÈëµÄÖµÔõô»ñµÃ,¶¼²»ÖªµÀ,ºóÀ´baidu²ÅÖªµÀ,
     Óà textField1.getText()»ñµÃÊäÈëµÄÖµ;,
   ......

JavaÄÚ´æÒç³ö·ÖÀà

¹ØÓÚJavaÒç³ö·ÖÀ࣬ÎÒ¾­³£Åöµ½µÄÊÇÁ½ÀࣺһÀàÊÇjava.lang.OutOfMemoryError: Java heap space£¬Ò»ÀàÊÇjava.lang.OutOfMemoryError: PermGen space¡£
ÔÚÕâÁ½ÀàÖУ¬Ç°ÕßÅö¼ûµÄ´ÎÊý±È½ÏƵ·±¡£ÒòΪµ¼ÖÂJava heap spaceµÄÇé¿ö£¬ÓÐʱºò²¢²»ÊÇÄÚ´æ²»¹»£¬ËüÒ²»áÅ×´Ë´íÎóÐÅÏ¢¡£ÀýÈçÎÒ¾ÍÅöµ½¹ýÕâÑùµÄÇé¿ö£¬ÎÒµ±Ê±Í¨¹ýGCÈÕÖ¾·¢ÏÖ£¬ÄÚ´ ......

jpythonµ÷ÓÃjavaÀàµÄÄ£°å


ʹÓÃJPypeÄ£¿éÈÃPythonµ÷ÓÃJAVAµÄÀà
Python idea!   2009-03-24 19:44   ÔĶÁ267   ÆÀÂÛ0  
×ֺţº ´ó´ó  ÖÐÖР СС
¿´¿´Àý×Ó¾ÍÖªµÀÀ²£¬ÕæÊÇΪPython£¨²»ÊÇJython£¬¶øÊÇCPython£©ÌṩÁËÇ¿´óÁ¦Á¿£¡
Ê×ÏÈÔÚjavaϽ¨Á¢Ò»¸öÔÙÒ²¼òµ¥²»¹ýµÄ°ü£º
package org.wg3i.t ......

java+swing C/sģʽµÄsocket±à³ÌÓ볤¶ÌÁ¬½Ó

ʲôÊÇsocket
³¤Á¬½ÓÓë¶ÌÁ¬½Ó
Ëùν³¤Á¬½Ó£¬Ö¸ÔÚÒ»¸öTCPÁ¬½ÓÉÏ¿ÉÒÔÁ¬Ðø·¢ËͶà¸öÊý¾Ý°ü£¬ÔÚTCPÁ¬½Ó±£³ÖÆÚ¼ä£¬Èç¹ûûÓÐÊý¾Ý°ü·¢ËÍ£¬ÐèҪ˫·½·¢¼ì²â°üÒÔά³Ö´ËÁ¬½Ó£¬Ò»°ãÐèÒª×Ô¼º×öÔÚÏßά³Ö¡£
¶ÌÁ¬½ÓÊÇָͨÐÅË«·½ÓÐÊý¾Ý½»»¥Ê±£¬¾Í½¨Á¢Ò»¸öTCPÁ¬½Ó£¬Êý¾Ý·¢ËÍÍê³Éºó£¬Ôò¶Ï¿ª´ËTCPÁ¬½Ó£¬Ò»°ãÒøÐж¼Ê¹ÓöÌÁ¬½Ó¡£ 
±ÈÈçht ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ