用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_HOME: C:\j2sdk1.4.2_13
Path: C:\j2sdk1.4.2_13\bin;
Classpath:.;JAVA_HOME\lib\tools.jar ; JAVA_HOME\lib\dt.jar;
&n ......
对于学习static我们先来看两个例子:
//Example 1 Tst.java,no main() method
package com.blogchina.qb2049;
public class Tst
{
static { System.out.println("111111"); }
}
运行结果为: 111111
Exception in thread "main" java.lang.NoSuchMethodError: main
同样的道理看第二 ......
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"); ......
1、FACTORY(工厂模式)
2、BUILDER(建造模式)
3、FACTORY METHOD(工厂方法模式)
4、PROTOTYPE(原始模型模式)
5、SINGLETON(单例模式)
6、ADAPTER(适配器模式)
7、BRIDGE(桥梁模式)
8、COMPOSITE(合成模式)
9、DECORATOR(装饰模式)
10、FACADE(门面模式)
11、FLYWEIGHT(享元模式) ......
package org.bupt.test;
import java.util.ArrayList;
class MyResource {
ArrayList<Integer> arrList= new ArrayList<Integer>();
public MyResource(ArrayList<Integer> arrList) {
this.arrList = arrList;
&nbs ......