SWT:表丢失选择 [英] SWT: Table lost selection

查看:41
本文介绍了SWT:表丢失选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个如下所示的表格,但是当表格失去焦点时(例如单击某个按钮),选择也会丢失.如何避免这种情况?

I have a Table like below, but when table lost focus (click some button for example), selection lost too. How to avoid this ?

Table table = new Table(group, SWT.BORDER | SWT.FULL_SELECTION);
table.setLinesVisible(true);
table.setHeaderVisible(true);

table.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent arg0) {
        onSelection();
    }
});

选定的行:

选择丢失:

推荐答案

啊,所以当表格没有焦点时,您的表格没有显示选定的行?这是几个不同版本的 Windows 中的一个众所周知的问题.

Ahh, so your table does not show the selected row when the table does not have focus? That is a well known problem in several different editions of Windows.

请注意:这不是 SWT 问题,而只是某些 Windows 版本的工作方式!!

Please Note: It is not a SWT problem, but simply the way some editions of Windows work!!

这篇关于SWT:表丢失选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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