• 大小: 1.18MB
    文件类型: .7z
    金币: 1
    下载: 0 次
    发布日期: 2023-08-12
  • 语言: 其他
  • 标签: swing  excel功能  

资源简介

具有大部分的excel功能,源码,并且可以在此基础上二次开发

资源截图

代码片段和文件信息

package com.pengwei.table;


import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.print.PageFormat;
import java.awt.print.Paper;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import java.util.Enumeration;

import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintJobAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.MediaPrintableArea;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.KeyStroke;
import javax.swing.SizeSequence;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.MouseInputAdapter;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;

import com.pengwei.table.TableColumnResizer;
import com.pengwei.table.TableRowResizer;
import com.pengwei.table.ui.*;

public class Table extends JTable {

private static final long serialVersionUID = -653496452615175166L;
protected MouseInputAdapter rowResizer columnResizer = null; 
private  TablePopMenu tp;
private  TableCellRenderer rowHeadRender ;

protected TableMyUI tu;
/* private TableModelConest tmConest;
    public void setTableModelConest(TableModelConest tc){
     tmConest = tc;
    }
    public TableModelConest getTableModelConest(){
     return tmConest;
    }*/
    
    private PrinterJob printJob;    
    private PageFormat pf;
    private PageFormat pfPrevew;
    
    private HashPrintRequestAttributeSet pras ;
private PrintService[] printServices ;
private PrintService printService ;
private TablePrintSetup tpsetup;

    public boolean isAlt;
    
//设定的页边距
private double leftMarginrightMarginbottomMargintopMargin;
//设定的页眉和页脚
private double pageTopFootpageBottomFoot;
//打印的起始页号
private int printStartPage;
//工作表的保护密码
private String password=““;
//工作表的保护密码是否输入正确
private boolean isPassPwd;

public double scrollHorizontal;
public double scrollVertical;
public int scrollHeight;
public int scrollWidth;

//标记table否有更新过,用于关闭的提醒
    public boolean isUpdate;
    
private int intRowStart ;// TableModelConest.Init_Row;
private int intColStart ;// TableModelConest.Init_Col;

boolean isShowRowGrid

评论

共有 条评论