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

Beginning Java AWT and Swing in NetBeans

Ò»¡¢ÐÔÄÜÎÊÌâ
Ëæ×ÅJava 6¶ÔÓÚSwingÐÔÄܵĸĽø£¬SwingµÄÔËÐÐËÙ¶ÈÒѾ­¿ªÊ¼µÃµ½ÁË´ó´óµÄÌá¸ß£¬¿´¿´NetBeans¾ÍÖªµÀÁË£¬NetBeans¾ÍÊÇSwing¿ª·¢µÄ£¬Èç¹ûÄãÅÜSwingºÜÂý£¬ºÜºÄ×ÊÔ´£¬ÄÇôӦ¸Ã´Ó×Ô¼ºµÄ³ÌÐòÉÏÕÒÕÒÎÊÌ⣬ÍƼöʹÓÃNetBeans×Ô´øµÄProfile²éÕÒÔ­Òò£¬½Ì³ÌÔÚÕâÀï – Profile Introduce.
¶þ¡¢LookAndFeel
ÓÃSwing×öÆóÒµÓ¦ÓÃʱ£¬LookAndFeelµÄÑ¡ÔñºÍʹÓÃÊǾö¶¨Õâ¸öÏîÄ¿ÄÜ·ñ±»¿Í»§½ÓÊܵÄÒ»¸öºÜ´óÒòËØ£¬¼´ÒªºÃ¿´£¬ÓÖÒª¿¼ÂÇ¿çƽ̨µÄ¼æÈÝÐÔ£¬±ØҪʱ×Ô¼º»¹µÃÉè¼Æ²¿·ÖLookAndFeel£¬ ¿ÉÒÔ¿´¿´ÕâÀïÌṩµÄһЩ¿ªÔ´LookAndFeel£ºhttp://www.open-open.com/61.htm ºÍhttp://www.javootoo.com/¡£
Çл»LookAndFeel£º
UIManager.setLookAndFeel(LookAndFeelName);
SwingUtilities.updateComponentTreeUI(frame);
frame.pack();
 
Èý¡¢ºÏÀíµÄ¿ØÖƳõʼ»¯×é¼þºÍ×é¼þ³õʼ»¯µÄ˳Ðò¿ÉÒԺܴóµÄÌá¸ßÐÔÄÜ
 
¾Ù¸öÀý×Ó£ºÖ®Ç°ÎÒÃÇÏîÄ¿ÖÐÓÐÒ»¸öµØ·½£¬µ±´ò¿ª³ÌÐòʱ£¬»á³õʼ»¯¼¸Ê®¸öÉõÖÁ³É°Ù¸öJPanel£¬ÕâÏÔÈ»³ÉΪ³ÌÐòÆô¶¯Ê±ÂýµÄÒ»¸öÒòËØ£¬Ò²µ¼ÖÂÁËÓû§ÌåÑéµÄ½µµÍ£¬ÕâЩJPanelÍêÈ«¿ÉÒÔÔÚ³ÌÐòÆô¶¯ºóÔÙ¸ù¾ÝÓû§µÄÐèҪȥ³õʼ»¯£¬ÒòΪÓû§´ò¿ª³ÌÐòʱÕâЩPanel²»ÊDZØÐë¿´µ½µÄ¡£
ËÄ¡¢ÒªÓÐͳһµÄUI¹æ·¶
 
±ÈÈçButtonµÄ¸ß¶È£¬½ø¶ÈÌõµÄ¸ß¿íµÈ£¬Ò²¿ÉÒÔͨ¹ýUIManager¸øϵͳ×é¼þÉèÖÃͳһÊôÐÔ£¬±ÈÈçͳһÉ趨ButtonµÄ¼ä¾àºÍ×ÖÌ壺
UIManager.put("Button.margin", new Insets(2, 5, 2, 5));
UIManager.put("Button.font", new Font("ËÎÌå", Font.PLAIN, 13));
Îå¡¢¶àÏ̵߳ÄʹÓÃ
ÓÃSwing×öµÄ¶¼ÊǽçÃæµÄ¶«Î÷£¬Èç¹û½çÃæ¼ÙËÀ»òÕßÓû§µÈ´ýʼþÌ«³¤£¬ÄÇôÓû§ÌåÑé±ØÈ»ÊDz»ºÃµÄ£¬ÕâÀï¾ÍÐèÒªÓõ½¶àÏ̵߳ÄʹÓÃÁË£¬µ±½çÃæ´¦ÀíÒ»¸öÇëÇóʱ£¬²»ÄÜÈýçÃæ¼ÙËÀÁË£¬ÐèÒªºǫ́ÁíÒ»¸öÏß³ÌÈ¥×ö´¦Àí£¬È»ºó½«½á¹û·µ»Øµ½SwingỊ̈߳¬Õâ¿é¿ÉÒÔ¿´¿´SwingWorkerµÄ½éÉÜ¡£
Áù¡¢²¼¾Ö¹ÜÀíÆ÷
²¼¾Ö¹ÜÀíÆ÷µÄʹÓÃÔÚSwingÀïÃæÊDZȽÏÖØÒªµÄ£¬ËüÖ±½Ó¾ö¶¨ÁËÄã½çÃæµÄÏÔʾЧ¹û£¬Ò²ÊDZȽÏÄÑÓõÄÒ»¿é£¬²»ºÃ¾ÙÀý×Ó£¬½¨Òé¶àÁ˽âÿ¸ö²¼¾Ö¹ÜÀíÆ÷µÄʹÓó¡¾°¡£
Æß¡¢JTable & JTree
ÔÚSwing×é¼þµÄʹÓÃÖгýÁ˲¼¾Ö¹ÜÀíÆ÷£¬¹À¼Æ¾ÍÊýJTableºÍJTreeµÄʹÓÃÉÔ΢ÓеãÂé·³ÁË£¬ÏÂÃæÎҾͷÖÏíһЩʵ¼ÊÏîÄ¿ÖÐJTableµÄһЩʵÀý£¬¹ØÓÚJTree£¬¿ÉÒÔµãÕâÀJTree ¾­Ñé ×Ü½á ¡£
JTableÏà¹Ø
1¡¢×Ô¶¨Òå±íÍ·ÅÅÐò
TableRowSorter rs = (TableRowSorter) table.getRowSorter();
Comparator<Integer> intComparator = ne


Ïà¹ØÎĵµ£º

Java, .Net·¢Õ¹·½ÏòºÍÇ°¾°


Java, .Net·¢Õ¹·½ÏòºÍÇ°¾°
JAVAÓïÑÔ·¢Ã÷ÒÑÓÐ10ÄêÀúÊ·,ÔÚIBM¡¢SUNµÈ¹«Ë¾µÄÍƶ¯ÏÂÒѾ­±È½ÏÎȶ¨Óë³ÉÊ죬»ñµÃÁË´ó¹æÄ£ÆóÒµµÄÆÕ±éÓ¦Óá£Ê±ÖÁ½ñÈÕ£¬J2EEÒѾ­·¢Õ¹³ÉΪһ¸ö¸²¸ÇÃæ¹ã£¬Ð§Âʸߣ¬Ò×ÓÃÐÔÇ¿µÄ¼¼Êõƽ̨£¬ÎüÒýÁË400Íò¿ª·¢Õߣ¬ÔÚÍøÂç¼¼Êõ±é¼°È«ÇòµÄµÄ½ñÌ죬¸üÓÐ17.5ÒŲ́É豸ʹÓÃJAVA¼¼Êõ.ͬʱ, Mustang°æ±¾µÄJ2EEÕýÔÚ½ôÂà ......

java·ºÐÍÏê½â

·ºÐÍ£¨Generic type »òÕßgenerics£©ÊÇ¶Ô Java ÓïÑÔµÄÀàÐÍϵͳµÄÒ»ÖÖÀ©Õ¹£¬ÒÔÖ§³Ö´´½¨¿ÉÒÔ°´ÀàÐͽøÐвÎÊý»¯µÄÀà¡£¿ÉÒÔ°ÑÀàÐͲÎÊý¿´×÷ÊÇʹÓòÎÊý»¯ÀàÐÍʱָ¶¨µÄÀàÐ͵ÄÒ»¸öռλ·û£¬¾ÍÏñ·½·¨µÄÐÎʽ²ÎÊýÊÇÔËÐÐʱ´«µÝµÄÖµµÄռλ·ûÒ»Ñù¡£
¿ÉÒÔÔÚ¼¯ºÏ¿ò¼Ü£¨Collection framework£©Öп´µ½·ºÐ͵Ķ¯»ú¡£ÀýÈ磬MapÀàÔÊÐíÄúÏòÒ»¸öMapÌí ......

java¶¯Ì¬µ÷ÓÃÀà

package tf;
public class TestPack {
public static void main(String [] args)
{
try
{
IAnimal cAnimal = new bird();
cAnimal.shout();
IAnimal animal =(IAnimal)java.lang.Class ......

»ùÓÚ JVMTI ʵÏÖ Java Ï̵߳ļà¿Ø

Ëæ×ŶàºË CPU µÄÈÕÒæÆÕ¼°£¬Ô½À´Ô½¶àµÄ Java Ó¦ÓóÌÐòʹÓöàÏ̲߳¢ÐмÆËãÀ´³ä·Ö·¢»ÓÕû¸öϵͳµÄÐÔÄÜ¡£¶àÏ̵߳ÄʹÓÃÒ²¸øÓ¦ÓóÌÐò¿ª·¢ÈËÔ±´øÀ´Á˾޴óµÄÌôÕ½£¬²»ÕýÈ·µØʹÓöàÏ߳̿ÉÄÜÔì³ÉÏß³ÌËÀËø»ò×ÊÔ´¾ºÕù£¬µ¼ÖÂϵͳ̱»¾¡£Òò´Ë£¬ÐèÒªÒ»ÖÖÔËÐÐʱÏ̼߳à¿Ø¹¤¾ßÀ´°ïÖú¿ª·¢ÈËÔ±Õï¶ÏºÍ¸ú×Ù Java Ïß³Ì״̬µÄÇл»¡£JDK 1.5 ¼°ÆäºóÐø°æ± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ