如何打印出一个JTable中的特定行/列? [英] How to print out specific rows/columns of a JTable?

查看:208
本文介绍了如何打印出一个JTable中的特定行/列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够打印完整的JTable,但实际上我想更多的从第10行打印一个JTable的只是一个特定部分,例如行50列和70列150。
怎么办呢?

I am able to print a full JTable, but actually I would like more to print just a specific part of a JTable, for example from Row 10 to Row 50 and Column 70 to Column 150. How to do it ?

推荐答案

获取所选择的片段小区边界和计算所需的区域(长方形),定义剪辑区域画唯一需要的区域,可打印使用图形的 translate()方法来渲染转变。

Get cell bounds for the selected fragment and calculate desired region (Rectangle), define clip region to paint only desired region, in the printable use Graphics's translate() method to shift the rendering.

这篇关于如何打印出一个JTable中的特定行/列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆