Tristate Checkboxes in Java

2020-02-10 14:53发布

I could really use a tri-stated checkbox in Java. It sounds like a simple thing, but I've only seen really ugly implementations [note: link now broken].

Three radio buttons just take up too much real estate and will probably be confusing for the users in my case. It's basically for a search dialog. I need true, false or "don't care" options. Is there a different technique that people use?

9条回答
在下西门庆
2楼-- · 2020-02-10 15:20

Use a drop-down.

查看更多
你好瞎i
3楼-- · 2020-02-10 15:20

JIDE have open sourced some very nice functionality in their Common Layer, one of which happens to be a tristate checkbox

Tristate checkboxes

I would suggest that you go run the webstart demo to see if it meets your needs

查看更多
一纸荒年 Trace。
4楼-- · 2020-02-10 15:20

I'd just use the one you posted.

As long as your complexity is in another class (that works) and it acts just like any other control, who cares? (That seems to be the assumption behind all of swing, most swing classes seem to be about this complicated.)

查看更多
登录 后发表回答