`
文章列表
/** class:SocketTest_SvrClit author:chengyun date: with:to test socket---server program; **/ import java.net.*; import java.io.*; public class SocketTest_Server { public static void main(String[] args) throws UnknownHostException,IOException,ConnectException { ServerSocket aServerSocket=new ServerS ...

Activity

1.一个Activity就是一个类,并且这个类要继承Activity 一.创建activity的要点 2.需要复写onCreate方法 3.每一个activity都需要在androidManifest.xml当中都要进行配置 4.为Activity添加必要的控件 二.多个activity之间的关系 多个activity之间的跳转,intent起到了重要的作用 三.intent的基本作用 一个intent对象包含了一组信息 1.Component name 决定你启动哪个activity. 2.action 指定另外activity要做哪些动作 3.data 向另外的activity传送的哪些 ...
在项目中的classes 中新建立一个log4j.properties文件即可; 在实际编程时,要使Log4j真正在系统中运行事先还要对配置文件进行定义。定义步骤就是对Logger、Appender及Layout的分别使用。Log4j支持两种配置文件格式,一种是XML格式的文件,一种是java properties(key=value)【Java特性文件(键=值)】。(这里只说明properties文件)  1、配置根Logger    其语法为:    log4j.rootLogger = [ level ] , appenderName1, appenderName2, … ...
package fileupload; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.Iterator; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.Ht ...
在使用spring容器的web应用中,业务对象间的依赖关系都可以用context.xml文件来配置,并且由spring容器来负责依赖对象 的创建。如果要在filter或者servlet中使用spring容器管理业务对象,通常需要使用WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext())来获得WebApplicationContext,然后调用WebApplicationContext.getBean("beanName")来获得对象的引用,这实际上是使用了依赖查找来获得对 ...
Sometimes, you project will have dependency on a jar which is not in official maven repository , and maybe it is propriety jar file which will never be part of maven repository . In this case, you have to put it to your local repository your self to solve the dependency. There is a install plug in to ...
     try{         Desktop d=Desktop.getDesktop();       URI u=new URI("http://www.baidu.com/s?wd=Java使用默认的浏览器打开指定的URI");      d.browse(u);         }       catch(IOException e){          e.printStackTrace();        }       catch(URISyntaxException e){        e.printStackTrace();        }
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="950" height="495" id="flashplay" align="middle"> <param name="a ...
public static String escape(String src) { int i; char j; StringBuffer tmp = new StringBuffer(); tmp.ensureCapacity(src.length() * 6); for (i = 0; i < src.length(); i++) { j = src.charAt(i); if (Character.isDigit(j) || Character.isLowerCase(j) || Character.isUpperCase(j)) ...
public class PropertyUtil {     /**      * 得到Properties      *      * @param path      * @return      */     public static Properties getProperties(String path) {         if (path == null || path.equals(""))             return null;         Properties prop = new Properties();         Inpu ...
return UUID.randomUUID().toString().replace("-", "");
public  Test() throws IOException     {       java.util.zip.ZipFile zf = new java.util.zip.ZipFile("d:/Archive.zip");       Enumeration e = zf.entries();       while(e.hasMoreElements())       {        ZipEntry ze = (ZipEntry) e.nextElement();        if(!ze.isDirectory())         System.out ...
public static void main(String args[]) {                 try {                       double ratio = 0.0; //缩放比例                        String filePath="d://sssss.jpeg";                     int width=475;                     int height=350;                    File f = new File(filePath);  ...
/**      * 截取flv文件的第一帧图片      */     public void getFlv(String file, String uuid, File flvPath) {         // 调用ffmpeg.exe         String ffmpegPath = request.getSession().getServletContext().getRealPath("/")+"/webResources/netedu/ffmpeg/Libs/ffmpeg.exe";         //保存路径         Str ...
//此类需要poi3.1的jar包 package com.glc; import java.awt.Dimension; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; i ...
Global site tag (gtag.js) - Google Analytics