8792321的博客
8792321 · 共 11 篇文章
[置顶] 自己写的一个Ext.grid.EditorGridPanel示例
<%@ page language="java" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>可编辑的表格</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <style type=…
2009-05-24 13:08 · ext · 评论(0)
poi 读取excel2007
import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xs…
2011-04-26 15:38 · Java · 评论(0)
iText创建PDF文件
//左、右、上、下页边距 Document doc =new Document(PageSize.A4, 50, 50, 10, 10); //A4横向 // Document doc = new Document(PageSize.A4.rotate()); PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream("d:/test.pdf")); //添加footer需要在document.open之前 //页眉 HeaderFooter header = new HeaderFooter(new Phrase(…
2011-04-14 15:17 · itext · 评论(1)
ibatis调用mysql存储过程示例
配置文件: sqlMapConfig.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> <sqlMapConfig> <settings cacheModelsEnabled="true" enhancementEnabled="true" lazyLoadingEnabled="true"…
2011-03-14 18:35 · ibatis · 评论(1)
ibatis调用oracle函数示例
利用空余时间写的一个简单例子,数据库是oracle10g. 配置文件: OracleSqlMapConfig.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> <sqlMapConfig> <!-- Configure a built-in transaction manager. If y…
2009-08-01 19:48 · ibatis · 评论(0)
ext表单控件
js文件 Ext.onReady(function() { // 对于提交中出现的乱码,在Ext中可以修改Request Header中Content-Type的设置 Ext.lib.Ajax.defaultPostHeader += ";charset=utf-8"; Ext.QuickTips.init(); Ext.apply(Ext.QuickTips.getQuickTip(), { dismissDelay : 0 }); Ext.form.Field.prototype.msgTarget = 'side'; var data = [['湖北', 'hubei'], ['江西'…
2009-07-14 23:34 · ext · 评论(0)
swing的不规则与透明窗体
public class ShapedWindow extends JFrame { public ShapedWindow() { super("不规则窗体"); this.setLayout(new FlowLayout()); JButton button = new JButton("退出按钮"); this.add(button); this.add(new JCheckBox("复选按钮")); this.add(new JRadioButton("单选按钮")); this.add(new JProgressBar(0, 100)); this.setSize(new Dime…
2009-07-09 23:24 · Java · 评论(0)
简单的文件搜索
class FileSeek { private static File[] arr = new File[1024 * 512]; static int p = -1; public boolean isEmpty() {// 判断是否为空 if (p > -1) return false; else return true; } public void push(File obj) {// 压栈 p++; arr[p] = obj; } public File pop() {// 出栈 if (p < 0) { try { throw new Exception("空堆栈"); } ca…
2009-07-08 22:19 · Java · 评论(0)
TreeMap应用
public class TreeSort { public static void main(String[] args) { CollatorComparator comparator = new CollatorComparator(); TreeMap<String, Object> map = new TreeMap<String, Object>(comparator); for (int i = 0; i < 10; i++) { String s = "" + (int) (Math.random() * 1000); map.put(s, s); } map.put("ab…
2009-05-26 15:14 · Java · 评论(0)
java录音程序
本人网上收集的两个java录音程序,文章出处不记得了. 程序1: import javax.sound.sampled.*; import javax.swing.JFrame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.Toolkit; import javax.swing.JPanel; import java.awt.event.ActionListener; import javax.sound.sampled.AudioInputStream; im…
2009-05-26 10:38 · Java · 评论(1)