过滤JComboBox项目

时间:2015-09-28 16:29:50

标签: java swing filter jcombobox

我有一些对象

public class SomeObject
{
    private boolean isActive;

    private String name;

    public SomeObject(String name)
    {
        this.name = name;
    }

    public String toString()
    {
        return name;
    }

    public boolean isActive()
    {
        return isActive;
    }

    public void setIsActive(boolean isActive)
    {
        this.isActive = isActive;
    }
}

JComboBox list;我使用SomeObject

list添加大约90个list.addItem(someObject);JButton toggle;

我还有一个按钮isActive();,按下该按钮后我想过滤JComboBox以显示JTable

的真实项目

TableRowSorter中我使用RowFilterJComboBox来实现这一目标。 $server的等价物是什么?

0 个答案:

没有答案