可以在jtable的某些列中显示pdf作为下载链接吗? [英] Can show pdf in some columns in jtable as link to download?

查看:85
本文介绍了可以在jtable的某些列中显示pdf作为下载链接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在JTable列中显示PDF作为下载链接吗?那可能吗 因为我已经在Google上进行搜索,但找不到任何内容,

Can I show a PDF in a column of a JTable as link to download!? Is that possible cause I've searched on Google but can't find anything,

实际上,我在名为projet(id,nomprojet,date,cout,rapportpdf,pdf)的数据库中有一个表.有些项目有融洽的关系,有些则没有,所以我在JTable

Actually I have table in database named projet(id,nomprojet,date,cout,rapportpdf,pdf). Some projet have a rapport some else no, so i have the project ligne in JTable

我是否可以将列作为链接​​将rapportpdf保存在桌面上,

Can i have column as link to save rapportpdf on Desktop,

推荐答案

也许一种方法是使包含链接的列显示为按钮.请参见表按钮列.然后,当用户单击按钮时,您可以显示pdf.

Maybe one approach would be to have the column containing the link to be rendered as a button. See Table Button Column. Then when the user clicks on the button you can display the pdf.

如果您希望该列看起来像常规的超链接,则需要创建一个自定义渲染器,使其像链接一样显示,并且需要一个自定义编辑器以在单击该动作时调用该动作. MadProgrammer为您提供了指向该教程的链接,该教程更详细地介绍了渲染器和编辑器.

If you want the column to look like a regular hyperlink, then you would need to create a custom renderer so it display like a link and a custom editor to invoke the action when you click on it. MadProgrammer has given you the link to the tutorial which explains renderers and editors in more detail.

这篇关于可以在jtable的某些列中显示pdf作为下载链接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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