易截截图软件、单文件、免安装、纯绿色、仅160KB

用Java 设置的定位打印作业

 import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.OrientationRequested;
public class Main {
  public static void main(String[] argv) throws Exception {
    // Set up the attribute set
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    aset.add(OrientationRequested.PORTRAIT);
    // aset.add(OrientationRequested.LANDSCAPE);
  }
}  


相关文档:

java 调用命令 备份mysql数据库

 代码如下:
  1  String command  =   " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
  2      try    {
  3     Process process& ......

JAVA:用多线程实现时间的动态显示

import java.awt.*;
import javax.swing.*;
import java.util.Date;
import java.awt.*;
class Time extends JFrame implements Runnable{//实现接口
Thread clockThread;
   JLabel jLabel=new JLabel();
   public Time()
   {
   Container con=this.getContentPane() ......

JAVA List to Array,Array to List

 1.List转换成为数组。(这里的List是实体是ArrayList)
调用ArrayList的toArray方法。
例:String[] arr = (String[])list.toArray(new String[size]);
2.数组转换成为List。
调用Arrays的asList方法。
例:List stooges = Arrays.asList("Larry", "Moe", "Curly"); ......

java中关于时间日期操作的常用函数

1.计算某一月份的最大天数
Calendar time=Calendar.getInstance();
time.clear();
time.set(Calendar.YEAR,year);
time.set(Calendar.MONTH,i-1);//注意,Calendar对象默认一月为0            
int day=time.getActualMaximum(Calendar.DAY_OF_MONTH);//本月份的天数 ......

Oracle 与在Java中的链接

转帖处:http://dong-java.javaeye.com/blog/375150 
1。推荐使用Oralce比较新的10.2.0.3 JDBC Drivers。这个版本对比9.2的最大的好处是DriverManager.setLoginTimeout函数是起作用的。设置了这个参数,在恶劣的网络环境中就不会有连接数据库的函数长时间不返回的情况。
2。JDBC Developer!ˉs Guide and Refer ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号