开发者

How to use RowFilter.dateFilter on JTable if it contains Strings

I want to use a RowFilter.dateFilter on a JTable, but my Table has only Strings formatted like this "yyyy-MM-dd". If it's not possible to filter my JTable through a dateFilter, how can I solve 开发者_如何转开发this problem?

thanks


You should be storing Date objects in your TableModel, not a String representation of the date. Then you can use a renderer to format the date however you want it displayed. See Table Format Renderers for an example renderer.

Now you can use the DateFilter the way it was designed to be used.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜