Code segment: access Cookie

  Abstract: The code segment: access Cookie 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width="753" border="0"> <tr> <td> </ td> </ tr> </ table> 
  Protected void setCookie (HttpServletResponse response, String cookieName, String value) ( 
  Cookie cookie = new Cookie (cookieName, value); 

  Cookie.setPath ("/"); 
  Response.addCookie (cookie); 
  ) 

  Protected Cookie getCookie (HttpServletRequest request, String name) ( 
  Cookie [] = cookies request.getCookies (); 
  Cookie returnCookie = null; 

  If (cookies! = Null) ( 
  For (int i = 0; i <cookies.length; i + +) ( 
  Cookie thisCookie [i] = cookies; 

  If (thisCookie.getName (). Equals (name)) ( 
  ReturnCookie = thisCookie; 
  Break; 
  ) 
  ) 
  ) 

  Return returnCookie; 
  ) </ Td> </ tr> <tr> 

  ↑ Back 

String paging code

  Abstract: string paging code 

  </ Td> </ tr> <tr> <td width="527" height="35" valign="top" class="ArticleTeitle"> use examples: 
  StringPager pager = new StringPager (); 
  Pager.setSizePerPage (5); / / characters per page 
  Pager.setText ( "12345678901 ");// need a long text paging 
  Pager.setCurrentPage (2); / / Current Page 

  System.out.println (pager.getTotalPage ());// total number of pages 
  System.out.println (pager.getCurrentPagedText pages of the current string ());// 

  Note: Java-based concept of the length of the string, each page is displayed in English and Chinese, as are the length of a page. 
  All source documents: 


  Package examples; 
  / * 
  * @ (#) StringPager.java 1.00 2004-10-10 
*
  * Copyright 2004 All rights reserved. 
  * PROPRIETARY / CONFIDENTIAL. Use is subject to license terms. 
  * / 


  / ** 
  * StringPager, string tabs. 
*
  * @ Author Liuchangjiong 
  * @ Version 1.00 2004-10-10 
  * / 
  (Public class StringPager 

  / ** Current page number * / 
  Private int currentPage = 1; 

  / ** Paging needs of the long string * / 
  Private String text; 

  / ** Characters per page, the default is 200 * / 
  Private int sizePerPage = 200; 

  / ** Total number of pages * / 
  Private int totalPage; 


  Public StringPager () () 

  / ** 
  * Return to the pages of string. 
  * @ Return 
  * / 
  Public String getCurrentPagedText () ( 
  Try ( 
  If (getCurrentPage () <getTotalPage ()) ( 
  Return getText (). Substring ((getCurrentPage () - 1) * getSizePerPage (), 
  GetCurrentPage () * getSizePerPage ()); 
  ) Else if (getTotalPage ()> 0) ( 
  Return getText (). Substring ((getCurrentPage () - 1) * getSizePerPage ()); 
  ) 
  ) Catch (Exception e) ( 
  E.printStackTrace (); 
  ) 
  Return null; 
  ) 

  / ** 
  * @ Return Returns the current page number. 
  * / 
  Public int getCurrentPage () ( 
  If (currentPage <= 0) currentPage = 1; 

  Return currentPage; 
  ) 

  / ** 
  * Set up the current page, from the beginning. 
*
  * @ Param currentPage 
  * The number to set the current page number. 
  * / 
  Public void setCurrentPage (int currentPage) ( 
  If (currentPage <= 0) ( 
  CurrentPage = 1; 
  ) 
  This.currentPage = currentPage; 
  ) 

  / ** 
  * @ Return Returns the total number of pages, if there is no data on a return. 
  * / 
  Public int getTotalPage () ( 
  If (getText () == null) totalPage = 0; 
  TotalPage = (int) Math.ceil (1.0 * getText (). Length () / getSizePerPage ()) / / total number of pages 

  If (totalPage == 0) 
  TotalPage = 1; 
  Return totalPage; 
  ) 

  / ** 
  * @ Param totalPage 
  * The totalPage to set. 
  * / 
  Public void setTotalPage (int totalPage) ( 
  This.totalPage = totalPage; 
  ) 

  Public static void main (String [] args) ( 
  StringPager pager = new StringPager (); 
  Pager.setSizePerPage (5); 
  Pager.setText ( "12345678901"); 
  Pager.setCurrentPage (2); 

  System.out.println (pager.getTotalPage ()); 
  System.out.println (pager.getCurrentPagedText ()); 
  ) 

  / ** 
  * @ Return Returns the number of characters per page. 
  * / 
  Public int getSizePerPage () ( 
  Return sizePerPage; 
  ) 

  / ** 
  * @ Param sizePerPage 
  * The number of characters per page to set. 
  * / 
  Public void setSizePerPage (int sizePerPage) ( 
  This.sizePerPage = sizePerPage; 
  ) 

  / ** 
  * @ Return Returns the paging needs of the long string. 
  * / 
  Public String getText () ( 
  Return text; 
  ) 

  / ** 
  * @ Param text 
  * The need for paging long strings to set. 
  * / 
  Public void setText (String text) ( 
  This.text = text; 
  ) 
  ) 

  Below are the jsp call: testpage.jsp (download) 
  </ Td> <td width="175" valign="top" class="ArticleTeitle"> 
  </ Td> </ tr> <tr> <td height="25" colspan="2" valign="top" class="ArticleTeitle"> 

  ↑ Back 

Information shows that the client code

  Abstract: The information showed that the client code 

  </ Td> </ tr> <tr> <td width="437" height="35" valign="top" class="ArticleTeitle"> client information shows that the code, including client ip, region, operating system and browser types. 
  Jsp following documents: Other code download. 

  <% @ Page contentType = "text / html; GBK charset ="%> 
  <% @ Page language = "java" import = "ip .*"%> 
<%
  String ip = request.getRemoteAddr (); 
  String [] addr = IPLocalizer.search (request); 
  / / String ua = request.getHeader ( "User-Agent"); 
  / / Out.println (ua + " 
");
  Out.println ( "Your IP is:" + ip + "from:" + addr [0] + addr [1 ]+"," 
  + OLUser.getUserSystem (request.getHeader ( "User-Agent "))+"," 
  + OLUser.getUserBrowser (request.getHeader ( "User-Agent "))); 
  %> </ Td> <td width="247" valign="top" class="ArticleTeitle"> 
  </ Td> </ tr> <tr> <td height="25" colspan="2" valign="top" class="ArticleTeitle"> 

  ↑ Back 

Generate authentication code Servlet

  Abstract: generate authentication code Servlet 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width = "100%" border = "0" cellspacing = "0" cellpadding = " 0 "> <tr> <td width="476" height="86" align="center" valign="top"> 

  Servlet generate authentication code, and Figure: 

  / / Fig. 5.6_02: ImageCodeMakerServlet.java / / read image files and generate the code of Servlet package com.fatcat.webchart; import javax.servlet .*; import javax.servlet.http .*; import java.io. *; import java.util .*; import java.awt.image .*; import java.awt .*; import javax.imageio .*; public class ImageCodeMakerServlet extends HttpServlet (String codeNumbers = ""; int width = 240, height = 60; / / HTTP get requests public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException (/ / empty buffer response.reset (); / / MIME type of attention here response.setContentType ( "image / png "); / / Set the page does not cache response.setHeader (" Pragma "," No-cache "); response.setHeader (" Cache-Control "," no-cache "); response.setDateHeader (" Expires ", 0) / / create a 240 X60 Image BufferedImage image = new BufferedImage (width, height, BufferedImage.TYPE_INT_RGB); / / graphics environment be targeted g Graphics g = image.getGraphics (); / / fill background g.setColor (Color.WHITE); g.fillRect (0, 0, width, height); for (int i = 0; i <4; i + +) (drawCode (g, i, request);) / / drawNoise (g, 30 ); / / Draw borders g.setColor (Color.black); g.drawRect (0, 0, width - 1, height - 1) / / Save the code into session in the HttpSession session = request.getSession (true ); session.setAttribute ( "codeNumbers" codeNumbers); / / Reset codeNumbers string = "" / / write use ImageIO category of image coding method ServletOutputStream sos = response.getOutputStream (); ImageIO.write (image , "PNG" sos); sos.close ();) / / loading image files and the mapping of the code public void drawCode (Graphics graphics, int i, HttpServletRequest request) (int number = (int) (Math.random ( ) * 10); String imageFilePath = 
  Request.getRealPath ( "\ \ images \ \" + + number. "Gif"; File imageFile = new File (imageFilePath); Image gifFile = null; try gifFile = (ImageIO.read (imageFile);) catch (Exception e) (System.out.println (e);) graphics.drawImage (gifFile, i * 60, 0, null); codeNumbers + = number;) / / Line Drawing interference public void drawNoise (Graphics graphics, int lineNumber) (graphics. setColor (Color.YELLOW) for (int i = 0; i <lineNumber; i + +) (int pointX1 = 1 + (int) (Math.random () * width); int pointY1 = 1 + (int) (Math. random () * height); int pointX2 = 1 + (int) (Math.random () * width); int pointY2 = 1 + (int) (Math.random () * height); graphics.drawLine (pointX1, pointY1 , pointX2, pointY2);)) / / HTTP post request, and the same public void doPost doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException (doGet (request, response);)) /******* ************************************************** ***************** * (C) Copyright 2004-2005 by Jingkui Zhong (Beijing Zhong Kui) and Huan Tang (Tanghuan) * All Rights Reserved. * * * * DISCLAIMER: The authors of this code have used their * * best efforts in preparing the code. These efforts include the * * development, research, and testing of the theories and programs * * to determine their effectiveness. The authors and publisher make * * no warranty of any kind, expressed or implied, with regard to these * * programs or to the documentation contained in these codes. The authors * * shall not be liable in any event for incidental or consequential * * damages in connection with, or arising out of, and the furnishing, * * performance, or use of these programs. * The following ******************************************/ 

  Please download other documents. 

  </ Td> <td width="208" valign="top"> </ td> </ tr> <tr> <td height="20" colspan="2"> 

  </ Td> </ tr> </ table> 

  </ Td> </ tr> <tr> 

  ↑ Back 

His code procedures

  Abstract: his code procedures 

  </ Td> </ tr> <tr> <td width="489" height="35" valign="top" class="ArticleTeitle"> procedure code below his output java runtime environment attributes, and help us to analyse some procedural issues: 
  If the file separators, the default file encoding format. 

  (Public class TestProperties 
  Public static void main (String [] args) ( 
  System.getProperties (). List (System.out); 
  ) 
  ) 

  In the output on my machine: 

  C: \ java> javac TestProperties.java 

  C: \ java> java TestProperties 
  — Listing properties – 
  Java.runtime.name = Java (TM) 2 Runtime Environment, Stand … 
  Sun.boot.library.path = C: \ Program Files \ Java \ j2re1.4.2_03 \ bin 
  Java.vm.version = 1.4.2_03-b02 
  Java.vm.vendor = Sun Microsystems Inc. 
  Java.vendor.url = http://java.sun.com/ 
  Path.separator =; 
  Java.vm.name = Java HotSpot (TM) Client VM 
  File.encoding.pkg = sun.io 
  User.country = CN 
  Sun.os.patch.level = Service Pack 1 
  Java.vm.specification.name = Java Virtual Machine Specification 
  User.dir = C: \ java 
  Java.runtime.version = 1.4.2_03-b02 
  Java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment 
  Java.endorsed.dirs = C: \ Program Files \ Java \ j2re1.4.2_03 \ li … 
  Os.arch x86 = 
  Java.io.tmpdir = C: \ DOCUME ~ 1 \ cwb \ LOCALS ~ 1 \ Temp \ 
  Line.separator = 

  Java.vm.specification.vendor = Sun Microsystems Inc. 
  User.variant = 
  Os.name = Windows XP 
  Sun.java2d.fontpath = 
  Java.library.path = C: \ WINDOWS \ system32;. C: \ WINDOWS \ Syst … 
  Java.specification.name = Java Platform API Specification 
  Java.class.version = 48.0 
  Java.util.prefs.PreferencesFactory = java.util.prefs.WindowsPreferencesFac … 
  Os.version = 5.1 
  User.home = C: \ Documents and Settings \ cwb 
  User.timezone = 
  Java.awt.printerjob = sun.awt.windows.WPrinterJob 
  File.encoding = GBK 
  Java.specification.version = 1.4 
  User.name = cwb 
  Java.class.path = d: \ j2sdk1.4.2 \ lib; c: \ j2ee1.3.1 \ lib \ j2 … 
  Java.vm.specification.version = 1.0 
  Sun.arch.data.model = 32 
  Java.home = C: \ Program Files \ Java \ j2re1.4.2_03 
  Java.specification.vendor = Sun Microsystems Inc. 
  User.language = zh 
  Awt.toolkit = sun.awt.windows.WToolkit 
  Java.vm.info mixed mode = 
  Java.version = 1.4.2_03 
  Java.ext.dirs = C: \ Program Files \ Java \ j2re1.4.2_03 \ li … 
  Sun.boot.class.path = C: \ Program Files \ Java \ j2re1.4.2_03 \ li … 
  Java.vendor = Sun Microsystems Inc. 
  File.separator = \ 
  Java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport … 
  Sun.cpu.endian little = 
  Sun.io.unicode.encoding = UnicodeLittle 
  Sun.cpu.isalist = pentium i486 i386 

  C: \ java> </ td> <td width="195" valign="top" class="ArticleTeitle"> 
  </ Td> </ tr> <tr> <td height="25" colspan="2" valign="top" class="ArticleTeitle"> 

  ↑ Back 

With a few lines of code to achieve sort

  Abstract: A few lines of code to sort 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> 
  <table Width="680" border="0"> <tr> <td width="394"> [original] 

  Abstract: Some people still take the trouble often see the use of the edge (the most common!) Or exchanged do sort, in fact with a few lines of code can be faster to achieve good sort, regardless of type or category is simple, Java array or Collection (Collection). 



  Simple types of sort 

  Simple types are no more than byte, char, short, int, long, float, double, and other data types, these types can not concentrate on only the use of the array.    Java.util.Arrays methods provide these types of sort of way (in fact there are many other useful method), the following is a simple sort int array: 

  Int arr [] = (2, 3, 1,10,7,4); </ td> <td width="276" align="center"> </ td> </ tr> </ table> 

  System.out.print ( "before sort:"); 

  For (int i = 0; i <arr.length; i + +) 

  System.out.print (arr [i] + ""); 

  System.out.println (); 



  Arrays.sort (arr); 

  System.out.print ( "after sort:"); 

  For (int i = 0; i <arr.length; i + +) 

  System.out.print (arr [i] + ""); 

  System.out.println (); 

  Output: 

  Before sort: 2 3 1 10 7 4 

  After sort: 1 2 3 4 7 10 

  We have seen the results in accordance with the order of ascending, and so are the following sort. 



  Object sort 

  Objects can be placed on the array, the same call Arrays.sort (Object [] arr) may It can also be put in the set, with the java.util.Collections 
  Sort (List list). 
  But this must implement the java.lang.Comparable interface.    There is only one way this interface: int compartTo (Object o) 
  When the object than the object of the introduction, returns a positive integer.    Programmer to class as an example: 

  Class Programmer implements Comparable ( 

  Private String name; 

  Private String language; 

  Private double pay; 

  Public Programmer (String name, String language, double pay) ( 

  This.name = name; 

  This.language = language; 

  This.pay = pay; 

  ) 



  Public int compareTo (Object o) ( 

  Programmer other = (Programmer) o; 

  Return (int) pay - (int) other.pay; 

  ) 



  Public String toString () ( 

  Return "(name:" + name + "language:" + + language, "money:" + pay + ")"; 

  ) 

  ) 

  Its sort: 

  ArrayList list = new ArrayList (); 

  List.add (new Programmer ( "San", "C", 12000)); 

  List.add (new Programmer ( "Si" and "Java", 200)); 

  List.add (new Programmer ( "Wang 5", "C + +", 5000)); 

  List.add (new Programmer ( "money 6", "VB", 3000)); 

  System.out.println ( "before sort:" + list); 

  Collections.sort (list); 

  System.out.println ( "after sort:" + list); 

  Output: 

  Before sort: [(name: Zhang, language: C, money: 12000.0), (name: Paul Lee, language: Java, money: 200.0) 
  (Name: Wang 5, language: C + +, money: 5000.0), (name: money 6. Language: VB, money: 3000.0)] 

  After sort: [(name: Paul Lee, language: Java, money: 200.0), (name: money 6. Language: VB, money: 3000.0), 
  (Name: Wang 5, language: C + +, money: 5000.0), (name: Zhang, language: C, money: 12000.0)] 



  Simple enough!    Comparable can look up the javadoc know that there are many types of the interface has been achieved, such as the sequencing of these few lines of code can get. 

  Recently see C # System.Array.sort found to sort the array, applicable to all to achieve the target of the IComparable interface, it seems that Microsoft's ability to draw is really strong ah! 



  Have the sort of 

  The above method, there is one question that has been in existence for a class, and did not realize Comparable interface, the use of a subset of a package? 
  Very troublesome (you can try the following example).    There is also a situation that is impossible to achieve on a variety of categories to sort.    To File Class as an example, it implements the Comparable interface, 
  However, in accordance with the sort of name.    If we sort according to size, or by modification time to sort?    In both cases, the use of java.util package Comparator interface: 

  Arrays.sort (Object [] arr, Comparator com) 

  Collections.sort (Object [] arr, Comparator com) 

  Comparator interface: 

  Public int compare (Object o1, Object o2) When o1 than o2 large return a positive integer 

  Public boolean equals (Object obj) to determine whether the obj and the Comparator with an object 

  Below use Comparator achieved according to the document file size or modified sort: 

  (Class FileUtils 

  Static class CompratorByLastModified implements Comparator ( 

  Public int compare (Object o1, Object o2) ( 

  File file1 = (File) o1; 

  File file2 = (File) o2; 

  File1.lastModified long diff = () - file2.lastModified (); 

  If (diff> 0) 

  Return 1; 

  Else if (diff == 0) 

  Return 0; 

  Else 

  Return -1; 

  ) 



  Public boolean equals (Object obj) ( 

  Return true; / / simple approach 

  ) 

  ) 



  Static class CompratorBySize implements Comparator ( 

  Public int compare (Object o1, Object o2) ( 

  File file1 = (File) o1; 

  File file2 = (File) o2; 

  File1.length long diff = () - file2.length (); 

  If (diff> 0) 

  Return 1; 

  Else if (diff == 0) 

  Return 0; 

  Else 

  Return -1; 

  ) 



  Public boolean equals (Object obj) ( 

  Return true; / / simple approach 

  ) 

  ) 



  ) 

  Call examples: 

  File dir = new File ( "C: \ \ temp"); 

  File = [] files dir.listFiles (); 



  System.out.print ( "before sort:"); 

  For (int i = 0; i <files.length; i + +) 

  System.out.print (files [i] + ""); 

  System.out.println (); 



  Arrays.sort (files); 

  System.out.print ( "sort by name:"); 

  For (int i = 0; i <files.length; i + +) 

  System.out.print (files [i] + ""); 

  System.out.println (); 



  Arrays.sort (files, new FileUtils.CompratorBySize ()); 

  System.out.print ( "sort by size:"); 

  For (int i = 0; i <files.length; i + +) 

  System.out.print (files [i] + ""); 

  System.out.println (); 



  Arrays.sort (files, new FileUtils.CompratorByLastModified ()); 

  System.out.print ( "sort by last modified:"); 

  For (int i = 0; i <files.length; i + +) 

  System.out.print (files [i] + ""); 

  System.out.println (); 



  Try to find its own directory of it.    Java class libraries in the use of these methods, under normal circumstances is not to write a Sorting Algorithm? 



  Finally attached layout complete code of points: 
  Import java.io. *; 

  Import java.util .*; 
  (Public class TestSort 

  Public static void main (String [] args) ( 

  SortSimpleType (); 

  SortComparable (); 

  SortComparator (); 

  ) 



  Public static void sortSimpleType () ( 

  Int arr [] = (2, 3, 1,10,7,4); 

  System.out.print ( "before sort:"); 

  For (int i = 0; i <arr.length; i + +) 

  System.out.print (arr [i] + ""); 

  System.out.println (); 

  Arrays.sort (arr); 

  System.out.print ( "after sort:"); 

  For (int i = 0; i <arr.length; i + +) 

  System.out.print (arr [i] + ""); 

  System.out.println (); 

  ) 



  Public static void sortComparable () ( 

  ArrayList list = new ArrayList (); 

  List.add (new Programmer ( "San", "C", 12000)); 

  List.add (new Programmer ( "Si" and "Java", 200)); 

  List.add (new Programmer ( "Wang 5", "C + +", 5000)); 

  List.add (new Programmer ( "money 6", "VB", 3000)); 

  System.out.println ( "before sort:" + list); 

  Collections.sort (list); 

  System.out.println ( "after sort:" + list); 

  ) 



  Public static void sortComparator () ( 

  File dir = new File ( "C: \ \ java"); 

  File = [] files dir.listFiles (); 



  System.out.print ( "before sort:"); 

  For (int i = 0; i <files.length; i + +) 

  System.out.println (files [i] + ""); 

  System.out.println (); 



  Arrays.sort (files); 

  System.out.print ( "sort by name:"); 

  For (int i = 0; i <files.length; i + +) 

  System.out.println (files [i] + ""); 

  System.out.println (); 



  Arrays.sort (files, new FileUtils.CompratorBySize ()); 

  System.out.print ( "sort by size:"); 

  For (int i = 0; i <files.length; i + +) 

  System.out.println (files [i] + ""); 

  System.out.println (); 



  Arrays.sort (files, new FileUtils.CompratorByLastModified ()); 

  System.out.print ( "sort by last modified:"); 

  For (int i = 0; i <files.length; i + +) 

  System.out.println (files [i] + ""); 

  System.out.println (); 



  ) 

  ) 



  Class Programmer implements Comparable ( 

  Private String name; 

  Private String language; 

  Private double pay; 



  Public Programmer (String name, String language, double pay) ( 

  This.name = name; 

  This.language = language; 

  This.pay = pay; 

  ) 



  Public int compareTo (Object o) ( 

  Programmer other = (Programmer) o; 

  Return (int) pay - (int) other.pay; 

  ) 



  Public String toString () ( 

  Return "(name:" + name + "language:" + + language, "money:" + pay + ")"; 

  ) 

  ) 



  (Class FileUtils 

  Static class CompratorByLastModified implements Comparator ( 

  Public int compare (Object o1, Object o2) ( 

  File file1 = (File) o1; 

  File file2 = (File) o2; 

  File1.lastModified long diff = () - file2.lastModified (); 

  If (diff> 0) 

  Return 1; 

  Else if (diff == 0) 

  Return 0; 

  Else 

  Return -1; 

  ) 



  Public boolean equals (Object obj) ( 

  Return true; / / simple approach 

  ) 

  ) 



  Static class CompratorBySize implements Comparator ( 

  Public int compare (Object o1, Object o2) ( 

  File file1 = (File) o1; 

  File file2 = (File) o2; 

  File1.length long diff = () - file2.length (); 

  If (diff> 0) 

  Return 1; 

  Else if (diff == 0) 

  Return 0; 

  Else 

  Return -1; 

  ) 



  Public boolean equals (Object obj) ( 

  Return true; / / simple approach 

  ) 

  ) 

  ) 
  The result: 


  C: \ java> java TestSort 
  Before sort: 2 3 1 10 7 4 
  After sort: 1 2 3 4 7 10 

  Before sort: [(name: Zhang, language: C, money: 12000.0), (name: Paul Lee, language: 
  Java, money: 200.0), (name: Wang 5, language: C + +, money: 5000.0), (name: money 6. Language: VB, money: 3000.0)] 

  After sort: [(name: Paul Lee, language: Java, money: 200.0), (name: money 6. Language: 
  VB, money: 3000.0), (name: Wang 5, language: C + +, money: 5000.0), (name: Zhang, language: C, money: 12000.0)] 

  Before sort: C: \ java \ class.bat 
  C: \ java \ onlyfun 
  C: \ java \ build.xml 
  C: \ java \ 1.txt 
  C: \ java \ native.bat 
  C: \ java \ hib.bat 
  C: \ java \ hjar 
  C: \ java \ src 
  C: \ java \ xdoclet 
  C: \ java \ lib2 
  C: \ java \ jsf.bat 
  C: \ java \ struts.bat 
  C: \ java \ TestSort.java 
  C: \ java \ TestSort.class 
  C: \ java \ jar 
  C: \ java \ messages_zh_TW1.properties 
  C: \ java \ messages.properties 
  C: \ java \ messages_zh_TW.properties 
  C: \ java \ Programmer.class 
  C: \ java \ FileUtils $ CompratorByLastModified.class 
  C: \ java \ FileUtils $ CompratorBySize.class 
  C: \ java \ FileUtils.class 
  C: \ java \ lib 
  C: \ java \ bean.xml 

  Sort by name: C: \ java \ 1.txt 
  C: \ java \ bean.xml 
  C: \ java \ build.xml 
  C: \ java \ class.bat 
  C: \ java \ FileUtils $ CompratorByLastModified.class 
  C: \ java \ FileUtils $ CompratorBySize.class 
  C: \ java \ FileUtils.class 
  C: \ java \ hib.bat 
  C: \ java \ hjar 
  C: \ java \ jar 
  C: \ java \ jsf.bat 
  C: \ java \ lib 
  C: \ java \ lib2 
  C: \ java \ messages.properties 
  C: \ java \ messages_zh_TW.properties 
  C: \ java \ messages_zh_TW1.properties 
  C: \ java \ native.bat 
  C: \ java \ onlyfun 
  C: \ java \ Programmer.class 
  C: \ java \ src 
  C: \ java \ struts.bat 
  C: \ java \ TestSort.class 
  C: \ java \ TestSort.java 
  C: \ java \ xdoclet 

  Sort by size: C: \ java \ hjar 
  C: \ java \ jar 
  C: \ java \ lib 
  C: \ java \ lib2 
  C: \ java \ onlyfun 
  C: \ java \ src 
  C: \ java \ xdoclet 
  C: \ java \ 1.txt 
  C: \ java \ native.bat 
  C: \ java \ jsf.bat 
  C: \ java \ struts.bat 
  C: \ java \ class.bat 
  C: \ java \ FileUtils.class 
  C: \ java \ hib.bat 
  C: \ java \ messages.properties 
  C: \ java \ FileUtils $ CompratorBySize.class 
  C: \ java \ FileUtils $ CompratorByLastModified.class 
  C: \ java \ bean.xml 
  C: \ java \ Programmer.class 
  C: \ java \ messages_zh_TW.properties 
  C: \ java \ messages_zh_TW1.properties 
  C: \ java \ build.xml 
  C: \ java \ TestSort.class 
  C: \ java \ TestSort.java 

  Sort by last modified: C: \ java \ lib 
  C: \ java \ jar 
  C: \ java \ hjar 
  C: \ java \ onlyfun 
  C: \ java \ 1.txt 
  C: \ java \ hib.bat 
  C: \ java \ src 
  C: \ java \ xdoclet 
  C: \ java \ build.xml 
  C: \ java \ lib2 
  C: \ java \ bean.xml 
  C: \ java \ class.bat 
  C: \ java \ struts.bat 
  C: \ java \ messages.properties 
  C: \ java \ messages_zh_TW1.properties 
  C: \ java \ messages_zh_TW.properties 
  C: \ java \ jsf.bat 
  C: \ java \ native.bat 
  C: \ java \ TestSort.java 
  C: \ java \ FileUtils.class 
  C: \ java \ FileUtils $ CompratorBySize.class 
  C: \ java \ FileUtils $ CompratorByLastModified.class 
  C: \ java \ Programmer.class 
  C: \ java \ TestSort.class 


  C: \ java> 

  </ Td> </ tr> <tr> 

  ↑ Back 

Quanbing Chinese characters into the JAVA program source code.

  Abstract: Quanbing Chinese characters into the JAVA program source code. 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width = "100%" border = "0" cellspacing = "0" cellpadding = " 0 "> <tr> <td height="86" colspan="2" align="center" valign="top"> 

  Quanbing Chinese characters into the JAVA program source code. 

  Below is the chart: 

  </ Td> </ tr> <tr> <td width="205" height="20" valign="top"> 

  </ Td> <td width="479" height="20"> 
  Download: 
  Flights enquiries and the counting procedures source 2006-01-13 
  JAVA version of Lightning Source 2006-01-12 
  Fireworks procedures 2006-01-10 
  An RSS parser source 2006-01-09 
  Guestbook board 2006-01-08 
  Iraqi tanks java pirated 2006-01-07 
  Gobang another procedure 2006-01-06 
  Call eclipse 2006-01-03 
  Gobang games online source 2006-01-03 
  Using Java to achieve Fractal procedures 2006-01-02 
  24 games magical source 2006-01-02 
  Jsp2.0 expression language learning materials 2005-12-31 
  'Storm' book v1.0 jsp version 2005-12-30 
  Shengjie JSP message boards source 2005-12-30 
  Versus network of international chess source 2005-12-29 
  CNDS community java magazine Phase II: J2SE 5.0 new features fine of 2005-12-28 
  C / S structure of the examination system source 2005-12-27 
  A library management procedures 2005-12-23 
  Also a spider games 2005-12-17 
  Gobang game 2006-09-26 
  Java examination procedures 2005-12-12 
  Applet piano simulation program 2005-12-10 
  An English typing procedures 2005-12-03 
  Java programming radio, multiple-choice, fill in the blank, judge Exercise 2005-12-02 
  Grasping HTTP header information tools ieHTTPHeader 2005-11-30 
  A simple voting procedures 2005-11-29 
  Shithead poker game source 2005-11-24 
  Scjp three sets of simulated test 2005-11-24 
  Simple calculator source 2005-11-22 
  Upload a document JSF components 2005-11-21 
  Hanoi Tower animation demo source 2005-11-20 
  Java examination title and answer a set of 2005-11-19 
  Jsp entry Example: good-electronic bookstore 2005-11-19 
  Java based exercises, tests that nine 2005-11-18 
  Ergo 0.93 Go-client source 2005-11-17 
  Basic knowledge of java Exercises and answers a set of 2005-11-16 
  Simulation tests that java and answer three sets of 2005-11-15 
  Picture for the Games can be 2005-11-15 
  Russian box online 2005-11-15 
  Java "program design basis" Exercises and answer three sets of 2005-11-14 
  Playing a chess spectrum procedures 2005-11-13 
  Jsf a paging component 2005-11-10 
  Web Form Password crackers 2005-11-06 
  A simple web browser source 2005-11-06 
  In Java made an issue of the Notes 2005-11-05 
  Sun SCJP certification exam Simulator Whizlabs SCJP 1.4 2005-10-31 
  Eat beans games 2005-10-28 
  Web traffic statistics with IP 2005-10-23 
  Zhang Jian's Lianliankan game 2005-10-21 
  Spider Solitaire games 2005-10-20 
  Java Rubik's cube 2005-10-19 
  Jsf study examples 2005-10-13 
  Another Lianliankan procedures 2005-10-06 
  Chinese chess Java version V3.0 2005-10-06 
  Jaoso news articles Publishing System 0.9.1 final 2005-10-02 
  SUN JAVA training materials SCJP examinations for Chinese edition of the book 2005-09-28 
  Database-based mail system 2005-09-22 
  Throwing eggs game 2005-09-17 
  JSTL entry marked with the core 2005-09-07 Introduction 
  24 points poker game 2005-09-05 
  MVC-based framework prepared by the minesweeper game 2005-08-21 
  Jsp a counter 2005-08-21 
  Java object persistence technology Hibernate 2005-08-21 
  Spring Framework development of a reference manual version 1.1 2005-08-21 
  FCKEditor 2.0b2 - JSP version of online html editor 2005-08-21 
  EWebEditor online text editor Exocet modified version 2005-08-21 
  Spring Gossip v0.4 2005-08-21 
  Java source 2005-08-31 achieve Lianliankan </ td> </ tr> </ table> 

  </ Td> </ tr> <tr> 

  ↑ Back 

Java prepared by the simple download manager (with source code)

  Abstract: java prepared by the simple download manager (with source code) 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> simple download tools, GUI interface, it can download more than one file, and report downloaded bytes few, download progress and completion percentage download status.    Xuchuan breakpoint support, to suspend, resume, cancel the download tasks. 

  This source of four documents: Download.java, DownloadManager.java, DownloadsTableModel.java, ProgressRenderer.java. 
  Commencement of the proceedings: 

  C: \ ja> javac *. java 

  C: \ ja> java DownloadManager 

  <table Width="731" border="0"> <tr> <td> </ td> </ tr> </ table> 
  Function TempSave (ElementID) (CommentsPersistDiv.setAttribute ( "CommentContent" document.getElementById (ElementID). Value); CommentsPersistDiv.save ( "CommentXMLStore");) function Restore (ElementID) (CommentsPersistDiv.load ( "CommentXMLStore"); document . getElementById (ElementID). CommentsPersistDiv.getAttribute value = ( "CommentContent");) </ td> </ tr> <tr> 

  ↑ Back 

A BASIC language interpreter (with source code)

  Abstract: A BASIC language interpreter (with source code) 

  </ Td> </ tr> <tr> <td width="470" height="35" valign="top" class="ArticleTeitle"> This is a java with a simple preparation of the BASIC language interpreter, only explain the following keywords: 
  PRINT INPUT IF THEN FOR NEXT 
  TO GOTO GOSUB RETURN END 
  Support digital, variable (A to Z), the operator (+-*/^=()<>>=<=<>), See Demo: 

  (Class SBDemo 
  Public static void main (String args []) 
  ( 
  If (args.length! = 1) ( 
  System.out.println ( "Usage: sbasic  ");
  Return; 
  ) 

  Try ( 
  SBasic ob = new SBasic (args [0]) / / input from the command line BASIC language source of 

  File name 
  Ob.run (); / / explain operation 
  ) Catch (InterpreterException exc) ( 
  System.out.println (exc); 
  ) 
  ) 
  ) 

  Run: 

  C: \ java> java SBDemo TEST2.BAS 
  This program demonstrates nested GOSUBs. 
  Enter a number: 9 
  9.0 18.0 27.0 36.0 45.0 54.0 63.0 72.0 81.0 
  C: \ java> 

  Below are the BASIC language source: TEST2.BAS 
  PRINT "This program demonstrates nested GOSUBs." 
  INPUT "enter a number:" I 
  GOSUB 100 

END

  100 FOR T = 1 TO I 
  X = X + I 
  GOSUB 150 
NEXT
RETURN

  150 PRINT X; 
  RETURN function TempSave (ElementID) (CommentsPersistDiv.setAttribute ( "CommentContent" document.getElementById (ElementID). Value); CommentsPersistDiv.save ( "CommentXMLStore");) function Restore (ElementID) (CommentsPersistDiv.load ( "CommentXMLStore"); document.getElementById (ElementID). CommentsPersistDiv.getAttribute value = ( "CommentContent");) </ td> <td width="214" valign="top" class="ArticleTeitle"> 
  </ Td> </ tr> <tr> <td height="25" colspan="2" valign="top" class="ArticleTeitle"> 

  ↑ Back 

A simple web browser source code

  Abstract: a simple web browser source code 

  - Source    <link> Href ="../../ css / index.css "rel =" stylesheet "type =" text / css "> </ head> function valiform () (if (document.form2.keyword.value = =""){ alert ( "Please enter keywords!"); document.form2.keyword.focus (); return false;)) function valiform1 () (if (document.form5.pinjianame.value =="") (alert ( "Please enter names!"); document.form5.pinjianame.focus (); return false;) if (document.form5.pinjiacontent.value ==""){ alert ( "Please enter evaluation of the content!") ; document.form5.pinjiacontent.focus (); return false;)) <body bgcolor="#FFFFFF" background="../../images/background.gif" leftmargin="0" topmargin="0"> <table width="756" height="1146" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="LTR"> <tr> <td width = "754" height = "78"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width = "19%" height = "65" > </ td> <td width="81%"> <table width = "94%" height = "53" border = "0" align = "center" cellpadding = "0" cellspacing = "0" class = " LTR "> <tr> <td height="53"> 

  </ Td> </ tr> </ table> </ td> </ tr> </ table> </ td> </ tr> <tr> <td height="20" class="ArticleTeitle"> <table width = "100%" height = "25" border = "0" cellpadding = "0" cellspacing = "0" bgcolor = "# 3399FF"> <tr> <td width="29%"> size of your position {{{{{{{{{{{{{{{{{{{{{{{{ â–¡ {{{{{{{{{{{{{{{{{{{{{{{{ â–¡ Release Date {{{{{{{{{{{{{{{{{{{{{{{{ â–¡ View 
  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width="739" border="0"> <tr> <td width = " 733 "> </ td> </ tr> </ table> <table width="97%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width =" 47 "height = "265" align = "center" valign = "top"> </ td> <td width="705" valign="top"> 
  <table Width="624" border="0"> <tr> <td width="377"> This is a simple web browser, forward, rewind functions.    Below is the chart: </ td> <td width="237"> </ td> </ tr> </ table> 

  </ Td> </ tr> <tr> <td height="44" colspan="2"> 

  </ Td> </ tr> </ table> 

  <script> Function TempSave (ElementID) (CommentsPersistDiv.setAttribute ( "CommentContent" document.getElementById (ElementID). Value); CommentsPersistDiv.save ( "CommentXMLStore");) function Restore (ElementID) (CommentsPersistDiv.load ( "CommentXMLStore" ); document.getElementById (ElementID). CommentsPersistDiv.getAttribute value = ( "CommentContent");) </ td> </ tr> <tr> 

  ↑ Back 

keep looking »