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

Java»æͼ

ÏÂÃæÊÇÎÒÈÏΪÕýÈ·µÄ×ö·¨£¨½áºÏ×Ô¼ºµÄ¾­ÑéдµÄ£¬Èç¹û²»ÕýÈ·£¬Çë´ó¼ÒÖ¸Õý£©£º
ÎҵĻæͼ¿Ø¼þÊÇJPanel£¬
³öÏÖ¹ö¶¯ÌõµÄÇ°Ìᣬ±ØÐëÈûæͼ¿Ø¼þ·ÅÔÚJScrollPaneÉÏ£¬
¶ÔÓÚJScrollPaneµÄLayout£¬Ã»ÓÐÌØÊâÒªÇó£¬ÏÂÃæÕâÑù¼´¿É£º
jScrollPane1.setViewportView(jPanel1);
È»ºó£¬ÁíÍâά³ÖÒ»¸öBufferedImage£¨¼ÙÉè½Ðimage1£©£¬¸÷ÖÖͼÏñµÄ´¦Àí¶¼ÊǶÔimage1½øÐС£
»­µÄʱºò£¬Ö»ÐèÒª°Ñimage1»­ÔÚjPanel1Éϼ´¿É¡£
ÏÂÃæÊÇÈçºÎ»­Í¼£º
£¨£±£©ÔÚÉú³ÉjPanel1µÄʱºò£¬ÐèÒª¸²¸Çpaint(Graphics g)·½·¨£¬ÔÚÀïÃæ°Ñimage1»­ÉÏÈ¥£º
jPanel1 = new JPanel(){
@Override
public void paint(Graphics g) {
super.paint(g);
if(image1 != null){
g.clearRect(0, 0, this.getWidth(), this.getHeight());
g.drawImage(image1, 0, 0, null);
g.dispose();
}
}
};
£¨£²£©ÔÚËùÓжÔimage1µÄ´¦ÀíÒÔºó£¬ÐèÒªµ÷ÓÃjPanel1.repaint() → ×¢£º»á×Ô¼ºµ÷ÓÃpaint(Graphics g)·½·¨
    ±ÈÈçÔÚ¶Ôimage1½øÐзŴóËõС£¬»òÕßÈ¥µôijЩÑÕÉ«ÒÔºó£¬ÐèÒªµ÷ÓÃjPanel1.repaint()
£¨£³£©ÔÚimage1µÄsizeÓб仯µÄʱºò£¬ÐèÒªµ÷Óãº
jPanel1.setPreferredSize(new Dimension(image1.getWidth(),image1.getHeight()));
jPanel1.updateUI();
ÕâÊǹؼü£¡£¡ÒòΪ²»ÐÞ¸ÄjPanel1µÄPreferredSizeµÄ»°£¬¹ö¶¯ÌõÓÀÔ¶¶¼³ö²»À´£¡£¡
×¢Ò⣺
    ¢ÙµÚÒ»´Î»æÖÆimage1ʱ£¬Ò²Ó¦¸Ãµ÷ÓÃÕâÁ½¾ä£¬ÒòΪimage1´Ónull±ä³ÉÓÐÖµ£¬sizeµ±È»Óб仯¡£
    ¢ÚÔÚjPanel1¸²¸ÇµÄpaint(Graphics g)·½·¨À²»Òªµ÷ÓÃÕâÁ½¾ä¡£ÒòΪµ÷ÓÃjPanel1.updateUI()ʱ£¬»á×Ô¶¯µ÷ÓÃrepaint()£¬½ø¶ø×Ô¶¯µ÷ÓÃpaint(Graphics g)£¬Ôì³ÉÎÞÏÞÑ­»·µ÷Óã¬CPUµÄÕ¼Óûá·Ç³£¸ß¡£


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

java exception javaÒì³£»ã×Ü(3)

java exception ½â¾ö·½°¸ - ÎÒµÄÒì³£Íø|Òì³£|exception   791 - java.lang.NoSuchMethodError 792 - RuntimeException 793 - org.hibernate.exception.SQLGrammarException 794 - Internal Error 795 - ×Ô¶¨ÒåÒì³£ 796 - org.dom4j.DocumentException 797 - java.net.SocketException 798 - Exception¶ÔÏó 799 - SQLE ......

Java Application Ö±½Óͨ¹ýjndiÁ¬½ÓÊý¾Ý¿â

 Ê¹ÓÃjar°ü:
 commons-pool-1.5.3.jar,tomcat-naming-common.jar,commons-pool-1.5.3-bin.zip,commons-dbcp.jar
 ×¢Òâ:jdbc Çý¶¯ÒªÓëÊý¾Ý¿â¼æÈÝ.
 package test.comm;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Hashtable;
import javax.naming.InitialCont ......

java È«ÅÅÁÐËã·¨

 import java.util.Arrays;
/**
 * ÇóÒ»¸öÊý×éµÄÈ«ÅÅÁÐËã·¨
 * @author Administrator
 */
public class Pai { 
 public void pai(char[] array,int start,int end){
  System.out.println(" -- ×éºÏ "+start+" µ½ "+end+" --");
  if(start==end){
  ......

Java BeanÔ­ÀíÓëÓ¦ÓÃ

   ¡¡¡¡1¡¢Ê²Ã´ÊÇJavaBean£¿  
   
  ¡¡¡¡JavaBeanÊÇÃèÊöJavaµÄÈí¼þ×é¼þÄ£ÐÍ£¬ÓеãÀàËÆÓÚMicrosoftµÄCOM×é¼þ¸ÅÄî¡£ÔÚJavaÄ£ÐÍÖУ¬Í¨¹ýJavaBean¿ÉÒÔÎÞÏÞÀ©³äJava³ÌÐòµÄ¹¦ÄÜ£¬Í¨¹ýJavaBeanµÄ×éºÏ¿ÉÒÔ¿ìËÙµÄÉú³ÉеÄÓ¦ÓóÌÐò¡£¶ÔÓÚ³ÌÐòÔ±À´Ëµ£¬×îºÃµÄÒ»µã¾ÍÊÇJavaBean¿ÉÒÔʵÏÖ´úÂëµÄÖظ´ÀûÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ