使按钮升序的按钮用Java降序 [英] Buttons which makes ascending & descending in java

查看:70
本文介绍了使按钮升序的按钮用Java降序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生您好,
我已经在GUI窗口中显示了Table,即table s
从数据库(MSSQL-SQL SERVER)中检索.

我想要的是每一列我们需要插入两个按钮,如果一个
按钮单击时,其列按升序排列,如果其他
按钮按降序排列其列.根据其行,其他行也应更改.
.
这两个按钮出现在顶部的每一列中.

按键使用哪种方法来使&上升?降序插入JTable中的每一列.

请给我建议.

谢谢&问候
我建议您执行大多数网格的操作,按一下列标题以对其进行升序然后降序排序.这样做的好处是动作正常.
顶部实际上是对行进行排序,请看以下示例中的. [ 解决方案

I would suggest that you do what most grids do, clcik on the heading for the column to sort it ascending then descending. The good thing about that is the action is normal.
Top actually sort the rows, have a look
at these examples.[^]


Sir,
I got the solution ,after using this method setAutoCreateRowSorter(true) in main program,we can make the the column in the ascending & descending order with there alphabets & with there rows ordered automatically.


这篇关于使按钮升序的按钮用Java降序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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