将加载圈添加到JTable [英] Add loading circle to JTable
问题描述
我有一个从数据库加载数据的JTable。因为有时数据太多,我想在Jtable中添加一个加载圈来通知用户数据正在加载。这是我希望如何的图像:
I have a JTable that loads data from a database. Because sometimes there's too much data, I would like to add a loading circle inside the Jtable to notify the user that the data is being loaded. Here is an image of how I would like it to be:
这可能吗?如何在Swing中完成?
Is this possible? How can it be done in Swing?
PS:我不想使用进度条,我只想要表格中的圆圈。
PS: I don't want to use the progress bar, I just want the circle inside the table.
更新:该表是GUI的一部分,我只想禁用或显示JTable中的加载,并保持其他组件不变。
UPDATE: The table is part of the GUI and I only want to disable or show the loading inside the JTable and leave the other components intact.
推荐答案
1)到半透明&莫代尔& un_decorated JDialog(阻止鼠标事件发送到父级)
1) to Translucent & Modal & un_decorated JDialog (block Mouse event to the parent)
2)到GlassPane(可以阻止鼠标事件)
2) to GlassPane (can block Mouse event)
3)到JViewport
3) to JViewport
编辑
如果你的 SQL解释器
支持分页
,然后拆分 SQL ResultSet
(5 - 20件)并使用 JProgressBar
而不是循环图像
,
if your SQL interpreter
supports Paginations
, then split SQL ResultSet
(5 - 20 pieces) and use JProgressBar
rather than cycled Images
,
这篇关于将加载圈添加到JTable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!