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

Java SWT 窗口居中对齐

public static void CentreWnd(Shell shell){
int width = shell.getMonitor().getClientArea().width;
int height = shell.getMonitor().getClientArea().height;
int x = shell.getSize().x;
int y = shell.getSize().y;
if (x > width) {
shell.getSize().x = width;
}
if (y > height) {
shell.getSize().y = height;
}
shell.setLocation((width - x) / 2, (height - y) / 2);
}


相关文档:

java jxl添加水印(基于jxl2.6.12修改编译版)_

因数据安全,需要将生成的报表xls,添加水印,所以自已在jxl中进行代码修改。
使用例子
public class testJxl {
public static void main(String[] args) throws Exception {
OutputStream out = new FileOutputStream("./aaaa.xls"); // 写入到FileInputStream
WritableWorkbook wwb= Workbook.createWorkbook(out);
......

java homework

使用java.lang.Math类,生成500个0~99的随机数,进行排序输出,并求最大值、最小值、平均值、标准差、方差、均方差;
import java.lang.Math;
import java.util.Arrays;
public class Main {
public static void main(String args[]) {
//create random
int [] data =new int[500];
double sum = 0, avg =0; ......

JAVA System.getProperty()参数


Java代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://xiaoxinshome.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" quality="high" flashvars="clipboard=%20%20%20%20%20 ......

java 数组操作,从数组a中删除数组b中存在的元素

 //从数组a中删除数组b中存在的元素
 String stra[] = {"g","b","c","h","k"};//原始数组
  String strb[] = {"g","k"};   //移除的元素
  ArrayList list = new ArrayList();
//方法一
  for(int i=0;i<stra.length;i++){
   int n=0;
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号