如何在 SWT 中添加开/关滑块? [英] How to add an on/off sliders in SWT?

查看:29
本文介绍了如何在 SWT 中添加开/关滑块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个类似的问题,但它在摇摆.我想在 SWT 中做同样的事情.

I found a similar question on SO but it is in Swing. I want the same thing in SWT.

那么如何在 SWT 中制作开/关滑块?

So how can I make an ON/OFF slider in SWT?

推荐答案

蛋白石项目有一个SwitchButton 这应该正是您要搜索的内容.这是截图:

The opal project has a SwitchButton which should be exactly what you are searching for. Here is a screenshot:

你可以这样使用它:

SwitchButton button = new SwitchButton(shell, SWT.NONE);
button.setTextForSelect("ON");
button.setTextForUnselect("OFF");

这篇关于如何在 SWT 中添加开/关滑块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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