??xml version="1.0" encoding="utf-8" standalone="yes"?>91在线观看免费高清,精品久久人人做人人爱,久久精品黄色 http://www.aygfsteel.com/vip01/category/26301.html单实?---逻辑清楚 zh-cn Wed, 26 Dec 2007 03:37:19 GMT Wed, 26 Dec 2007 03:37:19 GMT 60 学习Java6(十五)工具cArrays(1)数组copy http://www.aygfsteel.com/vip01/archive/2007/12/26/170460.html交口U赞 交口U赞 Wed, 26 Dec 2007 01:10:00 GMT http://www.aygfsteel.com/vip01/archive/2007/12/26/170460.html http://www.aygfsteel.com/vip01/comments/170460.html http://www.aygfsteel.com/vip01/archive/2007/12/26/170460.html#Feedback 2 http://www.aygfsteel.com/vip01/comments/commentRss/170460.html http://www.aygfsteel.com/vip01/services/trackbacks/170460.html Arrays.copyOf(base, 4); copy 目标的前几个成员
Arrays.copyOfRange(base, 3, 6); 指定copy的范?nbsp; 阅读全文 ]]> 学习Java6(?控制?2)格式化输?/title> http://www.aygfsteel.com/vip01/archive/2007/12/26/170452.html交口U赞 交口U赞 Wed, 26 Dec 2007 00:55:00 GMT http://www.aygfsteel.com/vip01/archive/2007/12/26/170452.html http://www.aygfsteel.com/vip01/comments/170452.html http://www.aygfsteel.com/vip01/archive/2007/12/26/170452.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/170452.html http://www.aygfsteel.com/vip01/services/trackbacks/170452.html 阅读全文 ]]> 学习Java6(十四)排序工具cNavigableSet http://www.aygfsteel.com/vip01/archive/2007/12/25/170303.html交口U赞 交口U赞 Tue, 25 Dec 2007 06:16:00 GMT http://www.aygfsteel.com/vip01/archive/2007/12/25/170303.html http://www.aygfsteel.com/vip01/comments/170303.html http://www.aygfsteel.com/vip01/archive/2007/12/25/170303.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/170303.html http://www.aygfsteel.com/vip01/services/trackbacks/170303.html 阅读全文 ]]> 学习Java6(十三)新的国家语言支持 http://www.aygfsteel.com/vip01/archive/2007/12/24/169959.html交口U赞 交口U赞 Mon, 24 Dec 2007 02:27:00 GMT http://www.aygfsteel.com/vip01/archive/2007/12/24/169959.html http://www.aygfsteel.com/vip01/comments/169959.html http://www.aygfsteel.com/vip01/archive/2007/12/24/169959.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/169959.html http://www.aygfsteel.com/vip01/services/trackbacks/169959.html 阅读全文 ]]> 学习Java6(十二)日期工具cTimeUnit http://www.aygfsteel.com/vip01/archive/2007/12/21/169368.html交口U赞 交口U赞 Fri, 21 Dec 2007 08:53:00 GMT http://www.aygfsteel.com/vip01/archive/2007/12/21/169368.html http://www.aygfsteel.com/vip01/comments/169368.html http://www.aygfsteel.com/vip01/archive/2007/12/21/169368.html#Feedback 1 http://www.aygfsteel.com/vip01/comments/commentRss/169368.html http://www.aygfsteel.com/vip01/services/trackbacks/169368.html 阅读全文 ]]> 学习Java6(十一)集合对象--堆栈 http://www.aygfsteel.com/vip01/archive/2007/09/30/149913.html交口U赞 交口U赞 Sun, 30 Sep 2007 07:23:00 GMT http://www.aygfsteel.com/vip01/archive/2007/09/30/149913.html http://www.aygfsteel.com/vip01/comments/149913.html http://www.aygfsteel.com/vip01/archive/2007/09/30/149913.html#Feedback 9 http://www.aygfsteel.com/vip01/comments/commentRss/149913.html http://www.aygfsteel.com/vip01/services/trackbacks/149913.html 阅读全文 ]]> FormatSqlResult2.0 增加对中文和和空列的识别 http://www.aygfsteel.com/vip01/archive/2007/08/10/135725.html交口U赞 交口U赞 Fri, 10 Aug 2007 01:55:00 GMT http://www.aygfsteel.com/vip01/archive/2007/08/10/135725.html http://www.aygfsteel.com/vip01/comments/135725.html http://www.aygfsteel.com/vip01/archive/2007/08/10/135725.html#Feedback 1 http://www.aygfsteel.com/vip01/comments/commentRss/135725.html http://www.aygfsteel.com/vip01/services/trackbacks/135725.html 1 import java.util.LinkedList; 2 3 import org.eclipse.swt.SWT; 4 import org.eclipse.swt.events.KeyAdapter; 5 import org.eclipse.swt.events.KeyEvent; 6 import org.eclipse.swt.events.SelectionAdapter; 7 import org.eclipse.swt.events.SelectionEvent; 8 import org.eclipse.swt.layout.FormAttachment; 9 import org.eclipse.swt.layout.FormData; 10 import org.eclipse.swt.layout.FormLayout; 11 import org.eclipse.swt.widgets.Button; 12 import org.eclipse.swt.widgets.Display; 13 import org.eclipse.swt.widgets.Label; 14 import org.eclipse.swt.widgets.Shell; 15 import org.eclipse.swt.widgets.Text; 16 17 public class FormatSqlResult { 18 19 private Text text; 20 21 protected Shell shell; 22 23 /** 24 * Launch the application 25 * 26 * @param args 27 */ 28 public static void main(String[] args) { 29 try { 30 FormatSqlResult window = new FormatSqlResult(); 31 window.open(); 32 } catch (Exception e) { 33 e.printStackTrace(); 34 } 35 } 36 37 /** 38 * Open the window 39 */ 40 public void open() { 41 final Display display = Display.getDefault(); 42 createContents(); 43 shell.open(); 44 shell.layout(); 45 while ( ! shell.isDisposed()) { 46 if ( ! display.readAndDispatch()) 47 display.sleep(); 48 } 49 } 50 51 /** 52 * Create contents of the window 53 */ 54 protected void createContents() { 55 shell = new Shell(); 56 shell.setLayout( new FormLayout()); 57 shell.setSize( 631 , 414 ); 58 shell.setText( " FormatSqlResult " ); 59 60 text = new Text(shell, SWT.V_SCROLL | SWT.MULTI | SWT.H_SCROLL | SWT.BORDER); 61 text.addKeyListener( new KeyAdapter() { 62 public void keyPressed(KeyEvent e) { 63 System.out.println(e.keyCode); 64 } 65 }); 66 final FormData fd_text = new FormData(); 67 fd_text.bottom = new FormAttachment( 100 , - 34 ); 68 fd_text.right = new FormAttachment( 100 , - 5 ); 69 fd_text.left = new FormAttachment( 0 , 0 ); 70 fd_text.top = new FormAttachment( 0 , 0 ); 71 text.setLayoutData(fd_text); 72 final Button formatButton = new Button(shell, SWT.NONE); 73 formatButton.addSelectionListener( new SelectionAdapter() { 74 public void widgetSelected(SelectionEvent e) { 75 String str = text.getText(); 76 if (str != null && str.length() > 0 ) { 77 text.setText(getSpaceText(str.replaceAll( " \r " , "" ))); 78 text.selectAll(); 79 } 80 81 } 82 }); 83 final FormData fd_formatButton = new FormData(); 84 fd_formatButton.left = new FormAttachment( 0 , 286 ); 85 fd_formatButton.right = new FormAttachment( 100 , - 287 ); 86 fd_formatButton.top = new FormAttachment( 100 , - 26 ); 87 fd_formatButton.bottom = new FormAttachment( 100 , - 4 ); 88 formatButton.setLayoutData(fd_formatButton); 89 formatButton.setText( " Format " ); 90 91 final Label label = new Label(shell, SWT.NONE); 92 final FormData fd_label = new FormData(); 93 fd_label.top = new FormAttachment( 100 , - 19 ); 94 fd_label.left = new FormAttachment( 100 , - 130 ); 95 fd_label.bottom = new FormAttachment( 100 , - 4 ); 96 fd_label.right = new FormAttachment( 100 , - 5 ); 97 label.setLayoutData(fd_label); 98 label.setText( " 版权所有:交口U赞 " ); 99 100 final Label formatsqlresult10Label = new Label(shell, SWT.NONE); 101 final FormData fd_formatsqlresult10Label = new FormData(); 102 fd_formatsqlresult10Label.top = new FormAttachment( 100 , - 19 ); 103 fd_formatsqlresult10Label.right = new FormAttachment( 0 , 180 ); 104 fd_formatsqlresult10Label.bottom = new FormAttachment( 100 , - 4 ); 105 fd_formatsqlresult10Label.left = new FormAttachment( 0 , 5 ); 106 formatsqlresult10Label.setLayoutData(fd_formatsqlresult10Label); 107 formatsqlresult10Label.setText( " FormatSqlResult version 2.0 " ); 108 109 final Button button = new Button(shell, SWT.NONE); 110 button.addSelectionListener( new SelectionAdapter() { 111 public void widgetSelected(SelectionEvent e) { 112 text.selectAll(); 113 } 114 }); 115 final FormData fd_button = new FormData(); 116 fd_button.top = new FormAttachment(formatButton, - 22 , SWT.BOTTOM); 117 fd_button.bottom = new FormAttachment(formatButton, 0 , SWT.BOTTOM); 118 fd_button.left = new FormAttachment( 0 , 239 ); 119 fd_button.right = new FormAttachment( 0 , 275 ); 120 button.setLayoutData(fd_button); 121 button.setText( " 全?/span>" ); 122 123 final Button button_1 = new Button(shell, SWT.NONE); 124 button_1.addSelectionListener( new SelectionAdapter() { 125 public void widgetSelected(SelectionEvent e) { 126 text.setText( "" ); 127 } 128 }); 129 final FormData fd_button_1 = new FormData(); 130 fd_button_1.left = new FormAttachment(formatButton, 9 , SWT.DEFAULT); 131 fd_button_1.right = new FormAttachment( 100 , - 242 ); 132 fd_button_1.bottom = new FormAttachment( 100 , - 4 ); 133 fd_button_1.top = new FormAttachment( 100 , - 26 ); 134 button_1.setLayoutData(fd_button_1); 135 button_1.setText( " 清空 " ); 136 } 137 138 public String getSpaceText(String allStr) { 139 String[] strs = allStr.split( " \n " ); 140 String lineStr; 141 int row = - 1 ; 142 if (strs != null && strs.length > 0 ) { 143 lineStr = strs[ 0 ]; 144 String[] lineStrs = lineStr.split( " \t " ); 145 row = lineStrs.length; 146 } 147 int [] max = new int [row]; 148 for ( int i = 0 ; i < max.length; i ++ ) { 149 max[i] = - 1 ; 150 } 151 LinkedList all = new LinkedList(); 152 for ( int i = 0 ; i < row; i ++ ) { 153 LinkedList list = new LinkedList(); 154 all.add(list); 155 } 156 for ( int i = 0 ; i < strs.length; i ++ ) { 157 lineStr = strs[i]; 158 String[] lineStrs = lineStr.split( " \t " ); 159 int length = - 1 ; 160 for ( int j = 0 ; j < row; j ++ ) { 161 if (j < lineStrs.length) { 162 length = lineStrs[j].getBytes().length; 163 if (length > max[j]) { 164 max[j] = length; 165 } 166 ((LinkedList) all.get(j)).add(lineStrs[j]); 167 } else { 168 ((LinkedList) all.get(j)).add( "" ); 169 } 170 171 } 172 } 173 174 StringBuffer sb = new StringBuffer(); 175 int line = ((LinkedList) all.get( 0 )).size(); 176 for ( int i = 0 ; i < line; i ++ ) { 177 for ( int j = 0 ; j < all.size(); j ++ ) { 178 String str = (String) ((LinkedList) all.get(j)).get(i); 179 int length = max[j] - str.getBytes().length + 1 ; 180 sb.append(str); 181 for ( int k = 0 ; k < length; k ++ ) { 182 sb.append( " " ); 183 } 184 } 185 sb.append( " \n " ); 186 } 187 return sb.toString(); 188 } 189 190 } 191
已制作成exeQ可以双L行,只支持WindowsQؓ了兼容jdk版本Q没敢用泛型?
下蝲Q?a href="/Files/vip01/FormatSqlResult2.rar">FormatSqlResult2.rar
]]>FormatSqlResult--SQL查询l果Q格式化工具Q已作成exeQ付源码 http://www.aygfsteel.com/vip01/archive/2007/08/09/135420.html交口U赞 交口U赞 Thu, 09 Aug 2007 03:02:00 GMT http://www.aygfsteel.com/vip01/archive/2007/08/09/135420.html http://www.aygfsteel.com/vip01/comments/135420.html http://www.aygfsteel.com/vip01/archive/2007/08/09/135420.html#Feedback 2 http://www.aygfsteel.com/vip01/comments/commentRss/135420.html http://www.aygfsteel.com/vip01/services/trackbacks/135420.html 阅读全文 ]]> 搞死人的oracle的日期国际化问题 http://www.aygfsteel.com/vip01/archive/2007/05/16/117804.html交口U赞 交口U赞 Wed, 16 May 2007 04:11:00 GMT http://www.aygfsteel.com/vip01/archive/2007/05/16/117804.html http://www.aygfsteel.com/vip01/comments/117804.html http://www.aygfsteel.com/vip01/archive/2007/05/16/117804.html#Feedback 4 http://www.aygfsteel.com/vip01/comments/commentRss/117804.html http://www.aygfsteel.com/vip01/services/trackbacks/117804.html 有些面在服务器上正常,在本地jboss׃正常? 阅读全文 ]]> 修改jboos的默认虚拟机 http://www.aygfsteel.com/vip01/archive/2007/04/18/111626.html交口U赞 交口U赞 Wed, 18 Apr 2007 06:23:00 GMT http://www.aygfsteel.com/vip01/archive/2007/04/18/111626.html http://www.aygfsteel.com/vip01/comments/111626.html http://www.aygfsteel.com/vip01/archive/2007/04/18/111626.html#Feedback 4 http://www.aygfsteel.com/vip01/comments/commentRss/111626.html http://www.aygfsteel.com/vip01/services/trackbacks/111626.html 阅读全文 ]]> SVN快速上手(二)权限分配Q控制到每个目录 http://www.aygfsteel.com/vip01/archive/2007/04/12/110138.html交口U赞 交口U赞 Thu, 12 Apr 2007 04:54:00 GMT http://www.aygfsteel.com/vip01/archive/2007/04/12/110138.html http://www.aygfsteel.com/vip01/comments/110138.html http://www.aygfsteel.com/vip01/archive/2007/04/12/110138.html#Feedback 2 http://www.aygfsteel.com/vip01/comments/commentRss/110138.html http://www.aygfsteel.com/vip01/services/trackbacks/110138.html 阅读全文 ]]> SVN快速上手(一Q安?/title> http://www.aygfsteel.com/vip01/archive/2007/04/12/110136.html交口U赞 交口U赞 Thu, 12 Apr 2007 04:43:00 GMT http://www.aygfsteel.com/vip01/archive/2007/04/12/110136.html http://www.aygfsteel.com/vip01/comments/110136.html http://www.aygfsteel.com/vip01/archive/2007/04/12/110136.html#Feedback 4 http://www.aygfsteel.com/vip01/comments/commentRss/110136.html http://www.aygfsteel.com/vip01/services/trackbacks/110136.html 阅读全文 ]]> replaceAll("\\\\", "\\\\\\\\")的秘?/title> http://www.aygfsteel.com/vip01/archive/2007/01/11/93115.html交口U赞 交口U赞 Thu, 11 Jan 2007 03:40:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/11/93115.html http://www.aygfsteel.com/vip01/comments/93115.html http://www.aygfsteel.com/vip01/archive/2007/01/11/93115.html#Feedback 5 http://www.aygfsteel.com/vip01/comments/commentRss/93115.html http://www.aygfsteel.com/vip01/services/trackbacks/93115.html 阅读全文 ]]> 真正最正确的用BATq行JAVA不显CDOSH口Q连闪一下都不闪Q?/title> http://www.aygfsteel.com/vip01/archive/2007/01/09/92527.html交口U赞 交口U赞 Tue, 09 Jan 2007 02:29:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/09/92527.html http://www.aygfsteel.com/vip01/comments/92527.html http://www.aygfsteel.com/vip01/archive/2007/01/09/92527.html#Feedback 40 http://www.aygfsteel.com/vip01/comments/commentRss/92527.html http://www.aygfsteel.com/vip01/services/trackbacks/92527.html 阅读全文 ]]> PO BO VO DTO POJO DAO概念及其作用Q附转换图) http://www.aygfsteel.com/vip01/archive/2007/01/08/92430.html交口U赞 交口U赞 Mon, 08 Jan 2007 09:52:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/08/92430.html http://www.aygfsteel.com/vip01/comments/92430.html http://www.aygfsteel.com/vip01/archive/2007/01/08/92430.html#Feedback 7 http://www.aygfsteel.com/vip01/comments/commentRss/92430.html http://www.aygfsteel.com/vip01/services/trackbacks/92430.html 阅读全文 ]]> 重定向控制台输出(?重定向tomcat的控制台输出(? http://www.aygfsteel.com/vip01/archive/2007/01/03/91551.html交口U赞 交口U赞 Wed, 03 Jan 2007 07:51:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/03/91551.html http://www.aygfsteel.com/vip01/comments/91551.html http://www.aygfsteel.com/vip01/archive/2007/01/03/91551.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/91551.html http://www.aygfsteel.com/vip01/services/trackbacks/91551.html call "%EXECUTABLE%" run %CMD_LINE_ARGS% catalina.bat最后一D늚相应的一句改?q里改的? :doneSetArgsq一D늚)Q? %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% >>ttt.txt 以后可查?lt;Tomcat_Home>/bin/ttt.txt?br /> 原帖http://topic.csdn.net/t/20041019/13/3469893.html 未经证实 哪位朋友认可行的请说下 不过按道理说应该可行 因ؓ他也是用的重定向操作W的 参见:重定向控制台输出(?WINDOWS下的巧妙猥琐的处理方?/font> ]]> 重定向控制台输出(?WINDOWS下的巧妙猥琐的处理方?/title> http://www.aygfsteel.com/vip01/archive/2007/01/03/91548.html交口U赞 交口U赞 Wed, 03 Jan 2007 07:47:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/03/91548.html http://www.aygfsteel.com/vip01/comments/91548.html http://www.aygfsteel.com/vip01/archive/2007/01/03/91548.html#Feedback 6 http://www.aygfsteel.com/vip01/comments/commentRss/91548.html http://www.aygfsteel.com/vip01/services/trackbacks/91548.html Vista时代的到?DOSq有用吗,命o行还有用?当然! 对于Lwin下的E序,在命令行中就支持输出重定? 比如在cmd下输入ping 127.0.0.1 >> c:\test.txt 控制没有M输出?! ȝ看c盘下的test.txt
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms q就是重定向操作W?>>"的作?br />
1 public class TestWinCon { 2 /** 3 * @param args 4 */ 5 public static void main(String[] args) { 6 System.out.println( " haha " ); 7 } 8 } 9
cmd下执?br />java TestWinCon >>aa.txt 会在本目录下生成aa.txt 内容是 haha
]]>重定向控制台输出(?其它JAVAE序控制台输?/title> http://www.aygfsteel.com/vip01/archive/2007/01/03/91543.html交口U赞 交口U赞 Wed, 03 Jan 2007 07:38:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/03/91543.html http://www.aygfsteel.com/vip01/comments/91543.html http://www.aygfsteel.com/vip01/archive/2007/01/03/91543.html#Feedback 1 http://www.aygfsteel.com/vip01/comments/commentRss/91543.html http://www.aygfsteel.com/vip01/services/trackbacks/91543.html 都可以写个前端程序去截获其控制台输出 process = Runtime.getRuntime().exec("你要执行的程?); InputStream in = process.getInputStream(); InputStream err =process.getErrorStream(); 然后安装重定向控制台输出(一)普通JAVAE序控制台输?/font> 一文中的方?分别各开一个线E去d. ]]> 重定向控制台输出(一)普通JAVAE序控制台输?/title> http://www.aygfsteel.com/vip01/archive/2007/01/03/91538.html交口U赞 交口U赞 Wed, 03 Jan 2007 07:01:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/03/91538.html http://www.aygfsteel.com/vip01/comments/91538.html http://www.aygfsteel.com/vip01/archive/2007/01/03/91538.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/91538.html http://www.aygfsteel.com/vip01/services/trackbacks/91538.html 反正是L人因为某些原因要捕获控制台输?.......(比如偶^_^) 对于普通的javaE序包括swtE序,我们可以把控制台输出重定向到文本文g或者界面文本框. 1 class ConsoleThread extends Thread { 2 private PipedInputStream pis = new PipedInputStream(); 3 4 private PipedOutputStream pos; 5 6 private BufferedReader reader = new BufferedReader( new InputStreamReader(pis)); 7 8 private boolean run = true ; 9 10 public ConsoleThread() throws IOException { 11 pos = new PipedOutputStream(pis); 12 } 13 14 public PipedOutputStream getOut() { 15 return pos; 16 } 17 18 public void run() { 19 String line = null ; 20 while (run) { 21 try { 22 line = reader.readLine(); 23 } catch (IOException ioe) { 24 break ; 25 } 26 if (line == null ) { 27 break ; 28 } else { 29 addText(line);//q里处理截获的控制台输出 30 } 31 } 32 } 33 34 public boolean isRun() { 35 return run; 36 } 37 38 public void setRun( boolean run) { 39 this .run = run; 40 } 41 }
调用:1 try { 2 ConsoleThread coThread = new ConsoleThread(); 3 System.setOut( new PrintStream(coThread.getOut(), true )); 4 System.setErr( new PrintStream(coThread.getOut(), true )); 5 coThread.start(); 6 } catch (IOException e) { 7 e.printStackTrace(); 8 }
但是有个问题,log4j输出到控制台的信息捕获不?....... 郁闷 log4j.properties1 log4j.rootLogger = DEBUG , stdout 2 3 log4j.appender.stdout = org.apache.log4j.ConsoleAppender 4 log4j.appender.console.Target = System.out 5 log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 6 log4j.appender.stdout.layout.ConversionPattern =% d % p [ % c] - % m % n
]]> 格式化System.currentTimeMillis() http://www.aygfsteel.com/vip01/archive/2007/01/03/91502.html交口U赞 交口U赞 Wed, 03 Jan 2007 03:05:00 GMT http://www.aygfsteel.com/vip01/archive/2007/01/03/91502.html http://www.aygfsteel.com/vip01/comments/91502.html http://www.aygfsteel.com/vip01/archive/2007/01/03/91502.html#Feedback 3 http://www.aygfsteel.com/vip01/comments/commentRss/91502.html http://www.aygfsteel.com/vip01/services/trackbacks/91502.html
1 import java.text.SimpleDateFormat; 2 import java.util.Locale; 3 4 5 public class FormatCurrentTime { 6 /** 7 * @param args 8 */ 9 public static void main(String[] args) { 10 11 SimpleDateFormat sdf = new SimpleDateFormat( "" , Locale.SIMPLIFIED_CHINESE); 12 sdf.applyPattern( " yyyyqMM月dd日 HH时mm分ssU?/span>" ); 13 System.out.println(sdf.format(System.currentTimeMillis())); 14 15 } 16 } 17
]]> 强!z!SWT实现d栏图标(pȝ托盘Q,带菜单和ToolTip http://www.aygfsteel.com/vip01/archive/2006/12/26/90127.html交口U赞 交口U赞 Tue, 26 Dec 2006 07:47:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/26/90127.html http://www.aygfsteel.com/vip01/comments/90127.html http://www.aygfsteel.com/vip01/archive/2006/12/26/90127.html#Feedback 6 http://www.aygfsteel.com/vip01/comments/commentRss/90127.html http://www.aygfsteel.com/vip01/services/trackbacks/90127.html 看到有位朋友在偶?a class="singleposttitle" id="viewpost1_TitleUrl" href="/vip01/archive/2006/12/25/89875.html">为RCPE序增加关闭提示和关闭到pȝ托盘”的文章里面的留aQ忍不住把自׃前N老的一帖子扒出来了?br />此文可能是当初最早最完善的SWT实现d栏图标,带菜单、带ToolTip的完整的例子?br />期间q有CSDN会员GhostValley;pdvv的指教?br />
1 import org.eclipse.swt.SWT; 2 import org.eclipse.swt.events.ShellListener; 3 import org.eclipse.swt.graphics.Image; 4 import org.eclipse.swt.internal.win32.OS; 5 import org.eclipse.swt.widgets.Display; 6 import org.eclipse.swt.widgets.Event; 7 import org.eclipse.swt.widgets.Listener; 8 import org.eclipse.swt.widgets.Menu; 9 import org.eclipse.swt.widgets.MenuItem; 10 import org.eclipse.swt.widgets.Shell; 11 import org.eclipse.swt.widgets.Tray; 12 import org.eclipse.swt.widgets.TrayItem; 13 14 public class MyTray { 15 public static void main(String[] args) { 16 Display display = new Display(); 17 Shell shell = new Shell(display); 18 // 下面两句的效果是Q在d栏不昄 19 // 感谢CSDN会员QGhostValley(D) 20 final int hWnd = shell.handle; 21 OS.SetWindowLong(hWnd, OS.GWL_EXSTYLE, OS.WS_EX_CAPTIONOKBTN); 22 Image image = new Image(display, 16 , 16 ); 23 final Tray tray = display.getSystemTray(); 24 if (tray == null ) { 25 System.out.println( " The system tray is not available " ); 26 } else { 27 final TrayItem item = new TrayItem(tray, SWT.NONE); 28 item.setToolTipText( " SWT TrayItem " ); 29 item.addListener(SWT.Show, new Listener() { 30 public void handleEvent(Event event) { 31 System.out.println( " show " ); 32 } 33 }); 34 item.addListener(SWT.Hide, new Listener() { 35 public void handleEvent(Event event) { 36 System.out.println( " hide " ); 37 } 38 }); 39 item.addListener(SWT.Selection, new Listener() { 40 public void handleEvent(Event event) { 41 System.out.println( " selection " ); 42 } 43 }); 44 item.addListener(SWT.DefaultSelection, new Listener() { 45 public void handleEvent(Event event) { 46 System.out.println( " default selection " ); 47 // show main 48 Shell s = event.display.getShells()[ 0 ]; 49 s.setVisible( true ); 50 s.setMinimized( false ); 51 } 52 }); 53 final Menu menu = new Menu(shell, SWT.POP_UP); 54 for ( int i = 0 ; i < 8 ; i ++ ) { 55 MenuItem mi = new MenuItem(menu, SWT.PUSH); 56 mi.setText( " Item " + i); 57 } 58 item.addListener(SWT.MenuDetect, new Listener() { 59 public void handleEvent(Event event) { 60 menu.setVisible( true ); 61 } 62 }); 63 item.setImage(image); 64 } 65 shell.addShellListener( new ShellListener() { 66 public void shellDeactivated(org.eclipse.swt.events.ShellEvent e) { 67 } 68 69 public void shellActivated(org.eclipse.swt.events.ShellEvent e) { 70 } 71 72 public void shellClosed(org.eclipse.swt.events.ShellEvent e) { 73 } 74 75 public void shellDeiconified(org.eclipse.swt.events.ShellEvent e) { 76 } 77 78 public void shellIconified(org.eclipse.swt.events.ShellEvent e) { 79 // 最化时不昄在Q务栏 80 // 感谢CSDN会员Qpdvv(我爱q) 81 ((Shell) e.getSource()).setVisible( false ); 82 } 83 }); 84 shell.setBounds( 50 , 50 , 300 , 200 ); 85 shell.open(); 86 while ( ! shell.isDisposed()) { 87 if ( ! display.readAndDispatch()) 88 display.sleep(); 89 } 90 image.dispose(); 91 display.dispose(); 92 } 93 }
]]> 获取当前l对路径 http://www.aygfsteel.com/vip01/archive/2006/12/26/90094.html交口U赞 交口U赞 Tue, 26 Dec 2006 06:00:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/26/90094.html http://www.aygfsteel.com/vip01/comments/90094.html http://www.aygfsteel.com/vip01/archive/2006/12/26/90094.html#Feedback 0 http://www.aygfsteel.com/vip01/comments/commentRss/90094.html http://www.aygfsteel.com/vip01/services/trackbacks/90094.html q个也是以前写的一点东西,今天要用Q又扒出来了。希望能l大家带来帮助:
1 2 public class GetPath { 3 public static void main(String[] args) { 4 GetPath test = new GetPath(); 5 System.out.println(test.getPath()); 6 } 7 8 public String getPath() { 9 return this .getClass().getResource( " / " ).getPath(); 10 } 11 } 12
]]> for each 循环Q可变参数的例子(JDK5Q?/title> http://www.aygfsteel.com/vip01/archive/2006/12/22/89461.html交口U赞 交口U赞 Fri, 22 Dec 2006 03:08:00 GMT http://www.aygfsteel.com/vip01/archive/2006/12/22/89461.html http://www.aygfsteel.com/vip01/comments/89461.html http://www.aygfsteel.com/vip01/archive/2006/12/22/89461.html#Feedback 3 http://www.aygfsteel.com/vip01/comments/commentRss/89461.html http://www.aygfsteel.com/vip01/services/trackbacks/89461.html 1 2 public class VariableArgs { 3 4 public static void main(String[] args) { 5 VariableArgs test = new VariableArgs(); 6 test.show(" 1 " , " 2 " ); 7 test.show(" 1 " , " hermit " , " 3 " ); 8 test.showObject(123 , " hermit " ); 9 test.addT(1 , 2 , 3 , 4 ); 10 }11 12 public void show(String strings) { 13 System.out.println(strings.length);14 for (String str : strings) { 15 System.out.print(str+ " \t " ); 16 }17 System.out.println();18 }19 20 public void showObject(Object objects) { 21 System.out.println(objects.length);22 for (Object obj : objects) { 23 System.out.print(obj.toString()+ " \t " ); 24 }25 System.out.println();26 }27 28 public void addT( int obj) { 29 System.out.println(obj.length);30 int rs = 0 ; 31 for ( int x : obj) { 32 rs+= x; 33 }34 System.out.println(rs);35 }36 37 }38 ]]>
վ֩ģ壺
差 |
|
¹ |
|
|
|
|
|
|
|
|
|
|
˫ |
|
|
dz |
|
ͩ® |
|
ʡ |
ɽ |
ͨμ |
|
ɽ |
ɽ |
|
ְ |
|
ͨ |
|
ϲ |
|
ʦ |
|
|
|
ƽ |
鶴 |
ĺ |
|