Archive for 07月, 2011
Published by
admin on
07月 23, 2011
在项目中需要自动生成EXCEL表,思路如下:先定制一模版,然后读取模版填充数据,代码大致如下:
package cn.bidlink.test;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
public class readxls {
private static final int CELL_TYPE_NUMERIC = 0;
static String filename = “test.xls”; // 要读取的excel表的文件名称
static String c0 = null; // 单元格的内容
static String c1 = null;
static String c2 = null;
// static String c3=null;
Read the rest of this entry »
Published by
admin on
07月 16, 2011
父窗口代码:
<input id=”txtOpener” type=”text” />
<input id=”Button1″ type=”button” value=”打开窗口” onclick=”window.open(’pagename.html’,null,’width=800,height=500′);” />
子窗口代码:
Read the rest of this entry »
Published by
admin on
07月 16, 2011
一、showModalDialog和showModelessDialog有什么不同?
showModalDialog:被打开后就会始终保持输入焦点。除非对话框被关闭,否则用户无法切换到主窗口。类似alert的运行效果。
showModelessDialog:被打开后,用户可以随机切换输入焦点。对主窗口没有任何影响(最多是被挡住一下而以。:P)
二、怎样才让在showModalDialog和showModelessDialog的超连接不弹出新窗口?
在被打开的网页里加上 <base target= “_self “> 就可以了。这句话一般是放在 <html> 和 <body> 之间的。
三、怎样才刷新showModalDialog和showModelessDialog里的内容?
在showModalDialog和showModelessDialog里是不能按F5刷新的,又不能弹出菜单。这个只能依靠javascript了,以下是相关代码:
Read the rest of this entry »
Published by
admin on
07月 16, 2011
常见的在javascript中需要弹出一新窗口进行相关操作,而后需要将操作的值返回给父窗口
一般而言弹出窗口有window.open 和window.showModalDialog 等
window.showModalDialog 子窗口 给父窗口赋值 的使用方法
(1)
父窗口
<script language=”JavaScript” type=”text/javascript”>
function openwin() {
var rsName = window.showModalDialog(”RetailShopSelect.aspx”, “newwindow”, “dialogWidth:700px,dialogHeight:540px;center:Yes;resizable:no;status:no;scroll:no;”)
if (rsName != null && rsName != “”) {
var strs = new Array();
strs = rsName.split(” “);
window.document.getElementById(”tbxRSId”).value = strs[0];
window.document.getElementById(”tbxRSNameCn”).value = strs[1];
}
}
</script><tr>
Read the rest of this entry »
Published by
admin on
07月 1, 2011
- public static void main(String[] args) {
- Calendar cal = new GregorianCalendar();
- //或者用Calendar cal = Calendar.getInstance();
-
- /**设置date**/
- SimpleDateFormat oSdf = new SimpleDateFormat (“”,Locale.ENGLISH);
Read the rest of this entry »