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

JavaÎļþ²Ù×÷´óÈ«£¨¾Å£©

61.Îļþ¼ÐÒÆ¶¯µ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser("ÇëÑ¡ÔñԴ·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°
·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%1 = Jfc.getSelectedFile().getParent();
Jfc = new JFileChooser("ÇëÑ¡ÔñÄ¿±ê·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%2 = Jfc.getSelectedFile().getParent();
62.Ŀ¼ÏÂËùÓÐÎļþ¼Ð¸´ÖƵ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser("ÇëÑ¡ÔñԴ·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°
·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%1 = Jfc.getSelectedFile().getParent();
Jfc = new JFileChooser("ÇëÑ¡ÔñÄ¿±ê·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%2 = Jfc.getSelectedFile().getParent();
63.Ŀ¼ÏÂËùÓÐÎļþ¼ÐÒÆ¶¯µ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser("ÇëÑ¡ÔñԴ·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°
·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%1 = Jfc.getSelectedFile().getParent();
Jfc = new JFileChooser("ÇëÑ¡ÔñÄ¿±ê·¾¶"); // ½¨Á¢Ñ¡Ôñµµ°¸¶Ô»°·½¿éºÐ Jfc
if (!Jfc.isFileSelectionEnabled()) {
return;
}
String %%2 = Jfc.getSelectedFile().getParent();
64.Ŀ¼ÏÂËùÓÐÎļþ¸´ÖƵ½ÕûºÏ²Ù×÷
/*
import java.io.*;
import java.util.*;
import javax.swing.*;
*/
JFileChooser Jfc = new JFileChooser


Ïà¹ØÎĵµ£º

Java³£¼ûµÄÎÊÌâ

1.Duplicated Code ´úÂëÖØ¸´¼¸ºõÊÇ×î³£¼ûµÄÒìζÁË¡£ËûÒ²ÊÇRefactoringµÄÖ÷ҪĿ±êÖ®Ò»¡£´úÂëÖØ¸´ÍùÍùÀ´×ÔÓÚcopy-and-pasteµÄ±à³Ì·ç¸ñ¡£ÓëËûÏà¶ÔÓ¦OAOOÊÇÒ»¸öºÃϵͳµÄÖØÒª±êÖ¾¡£ 2.Long method ËüÊÇ´«Í³½á¹¹»¯µÄ“ÒŶ¾”¡£Ò»¸ö·½·¨Ó¦µ±¾ßÓÐ×ÔÎÒ¶ÀÁ¢µÄÒâͼ£¬²»Òª°Ñ¼¸¸öÒâͼ·ÅÔÚÒ»Æð¡£ 3.Large Class ´óÀà¾ÍÊÇÄã°ÑÌ«¶ ......

javaÓëc#ͨÐÅÊý¾Ýת»»ÎÊÌâ

/ÓÉÓÚJAVAÓïÑÔµÄÊý¾ÝÀàÐͶ¼ÊÇÓзûºÅÀàÐÍ£¬¶øC# C++Ò»°ãÊý¾ÝÀàÐͶ¼ÊÇ·ÖÓзûºÅºÍÎÞ·ûºÅ,
//Òò´ËÔÚͨÐŹý³ÌÖд«µÝµÄByte[]ÎÞ·¨Ö±
½Óת»»³ÉC#ÐèÒªµÄÀàÐÍ£¬
//ÒÔǰµ¹ÊÇûעÒâÕâЩϸ½Ú£¬ÒòΪһ°ãÓÃÒ»ÖÖÓïÑÔ±à³Ì£¬
//´ó¶¼ÓÐÄÚÖõÄת»»·½·¨¡£¿çÓïÑÔ»·¾³µÄת»»¾ÍµÄ×Ô¼º¶¯
ÊÖÏë°ì·¨ÁË¡£
1¡¢javaµÄByte[]ת»»³Éc#µÄInt32
privat ......

java¿ì½Ý¼ü

Ctrl+1 ¿ìËÙÐÞ¸´(×î¾­µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌØ±ðʵÓÃ,¿ÉÒÔʡȥÏȼôÇÐ,ÔÙÕ³ÌùÁË)
Alt+↑ µ±Ç°ÐкÍÉÏÃæÒ»Ðн»»¥Î»ÖÃ(ͬÉÏ)
Alt+← ǰһ¸ö±à¼­µ ......

javaÉè¼ÆÄ£Ê½ Mediator

      Mediator ģʽµÄÄ¿µÄÊǶ¨ÒåÒ»¸ö¶ÔÏó,·â×°Ò»×é¶ÔÏó¼äµÄ½»»¥,ÕâÑù¾Í½µµÍÁ˽»»¥¶ÔÏó¼äµÄñîºÏ,ʹ¶ÔÏóºÍËûÃDzο¼µÄ¶ÔÏóÏÔʾµØ·ÖÀë,¾Í¿ÉÒÔ¶ÀÁ¢µØ±ä»¯ËûÃÇÖ®¼äµÄ¹ØÏµ.
     
      Ìõ¼þ:¶ÔÏó¼äµÄ½»»¥ºÍ¶ÔÏóµÄÆäËûÐÐΪ±È½Ï¶ÀÁ¢.
   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ