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

javaͼƬÑéÖ¤Âë

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class ImageRandom extends HttpServlet {
 /**
  * Constructor of the object.
  */
 public ImageRandom() {
  super();
 }
 public void processRequest(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
  response.setContentType("image/jpeg");
  response.setHeader("Pragma","No-cache");
  response.setHeader("Cache-Control","no-cache");
  response.setDateHeader("Expires", 0);
  HttpSession session=request.getSession();
  // ÔÚÄÚ´æÖд´½¨Í¼Ïó
  int width=60, height=20;
  BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  // »ñȡͼÐÎÉÏÏÂÎÄ
  Graphics graphics = image.getGraphics();
  //Éú³ÉËæ»úÀà
  Random random = new Random();
  // É趨±³¾°É«
  //graphics.setColor(this.getRandColor(100,150));
  graphics.setColor(Color.gray);
  graphics.clipRect(0, 0, width, height);
  //É趨×ÖÌå
  graphics.setFont(new Font("Times New Roman",Font.PLAIN,18));
  //»­±ß¿ò
  //graphics.setColor(new Color());
  //graphics.drawRect(0,0,width-1,height-1);
  
  // Ëæ»ú²úÉú50Ìõ¸ÉÈÅÏߣ¬Ê¹Í¼ÏóÖеÄÈÏÖ¤Âë²»Ò×±»ÆäËü³ÌÐò̽²âµ½
  graphics.setColor(getRandColor(100,200));
  for (int i=0;i<50;i++) {
   int x = ran


Ïà¹ØÎĵµ£º

JavaÕýÔò±í´ïʽÈëÃÅ

ÖÚËùÖÜÖª£¬ÔÚ³ÌÐò¿ª·¢ÖУ¬ÄÑÃâ»áÓöµ½ÐèҪƥÅä¡¢²éÕÒ¡¢Ìæ»»¡¢ÅжÏ×Ö·û´®µÄÇé¿ö·¢Éú£¬¶øÕâЩÇé¿öÓÐʱÓֱȽϸ´ÔÓ£¬Èç¹ûÓô¿±àÂ뷽ʽ½â¾ö£¬ÍùÍù»áÀ˷ѳÌÐòÔ±µÄʱ¼ä¼°¾«Á¦¡£Òò´Ë£¬Ñ§Ï°¼°Ê¹ÓÃÕýÔò±í´ïʽ£¬±ã³ÉÁ˽â¾öÕâһì¶ÜµÄÖ÷ÒªÊֶΡ£
 ´ó¼Ò¶¼ÖªµÀ£¬ÕýÔò±í´ïʽÊÇÒ»ÖÖ¿ÉÒÔÓÃÓÚģʽƥÅäºÍÌæ»»µÄ¹æ·¶£¬Ò»¸öÕýÔò±í´ïʽ¾ÍÊÇÓÉ ......

java¶ÁÊé±Ê¼ÇÕûÀí£ºÒ»Çж¼ÊǶÔÏó

Ò».ÓÃÒýÓòÙ×ݶÔÏó
       ÿÖÖ±à³ÌÓïÑÔ¶¼ÓÐ×Ô¼ºµÄÊý¾Ý²Ù×Ý·½Ê½¡£ÓÐʱºò£¬³ÌÐòÔ±±ØÐë×¢Ò⽫Ҫ´¦ÀíµÄÊý¾ÝÊÇʲôÀàÐÍ¡£ÄãÊÇÖ±½Ó²Ù×ݶÔÏ󣬻¹ÊÇÓÃijÖÖ»ùÓÚÌØÊâÓï·¨µÄ¼ä½Ó±íʾ(ÀýÈçCºÍC++ÀïµÄÖ¸Õë)ÔÚ²Ù×ݶÔÏó?
 
       ËùÓеÄÕâÒ»ÇÐÔÚjavaÀï¶¼µÃµ½Á˼ò»¯ ......

javaÓëC

½ñÌìûÓÐʲô´óÊ£¬ÏëÕÒjavaµÄ×ÊÁϾÍÀ´µ½ÕâÀïÁË£¡¸Ð¾õ»¹ÊÇCsdnµÄ×ÊÁϱȽ϶ࡣ
×î½ü»»Á˹¤×÷£¬ÒòΪһЩԭÒòÒÔǰµÄ¹¤×÷¡£ÎÒÒÔǰÊÇ×öCµÄ£¬ÏÖÔÚÒòΪ¹¤×÷µÄÐèҪȴҪ×öjava¡£
ÏÖÔÚ´ó¸Å¿´ÁËÒ»µãjavaµÄ¶«¶«£¬¸Ð¾õjavaµÄÓÃ;ºÜ¹ã£¬Ò²ºÜÓÅÐã¡£µ«ÊÇÏà±ÈÓÚCȴȱÉÙÁËһЩ͸Ã÷¶È£¬µ«Ò²¿ÉÄÜÕýÊÇÒòΪÕâЩ͸Ã÷
²ÅʹµÄËü·¢Õ¹µ½ÏÖÔÚ°É¡£java ......

JavaºËÐÄAPIÐèÒªÕÆÎյij̶È


JavaµÄºËÐÄAPIÊǷdz£ÅÓ´óµÄ,Õâ¸ø¿ª·¢ÕßÀ´Ëµ´øÀ´Á˺ܴóµÄ·½±ã£¬¾­³£ÈËÓÐÆÀÂÛ,javaÈóÌÐòÔ±±äɵ¡£
µ«ÊÇһЩÄÚÈÝÎÒÈÏΪÊDZØÐëÕÆÎյ쬷ñÔò²»¿ÉÒÔÊìÁ·ÔËÓÃjava£¬Ò²²»»áʹÓþͺÜÄѰìÁË¡£
1¡¢java.lang°üϵÄ80£¥ÒÔÉϵÄÀàµÄ¹¦ÄܵÄÁé»îÔËÓá£
2¡¢java.util°üϵÄ80£¥ÒÔÉϵÄÀàµÄÁé»îÔËÓã¬ÌرðÊǼ¯ºÏÀàÌåϵ¡¢Õý¹æ±í´ïʽ¡¢Ê±¼ä¡ ......

JAVAѧϰ֮·

Java³ÌÐòÔ±µ½¼Ü¹¹Ê¦µÄÍÆ¼öÔĶÁÊé¼®ÊÕ²Ø
Ò»¡¢Java±à³ÌÈëÃÅÀà
¶ÔÓÚûÓÐJava±à³Ì¾­ÑéµÄ³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶ÁʲôÈëÃÅÊé¼®¶¼Ò»Ñù£¬Õâ¸ö½×¶ÎÐèÒªÄã¿ìËÙµÄÕÆÎÕJava»ù´¡Óï·¨ºÍ»ù±¾Ó÷¨£¬×ÚÖ¼¾ÍÊÇ“àñàðÍÌÔæ²»ÇóÉõ½â”£¬ÏȶÔJavaÊìϤÆðÀ´ÔÙ˵¡£Óú̵ܶÄʱ¼ä¿ìËÙ¹ýÒ»±éJavaÓï·¨£¬Á¬ã´ø²Â¶àдд´úÂ룬Ҫ“ÖªÆäÈ»&r ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ