swing如何在JTable java中搜索元素?
我用java制作了一个JTable。 除了搜索表中的元素,我什么都可以做。 我想创建一个输入对话框,这就是我现在拥有的:
btnSearch = new JButton("Search");
btnSearch.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String name = JOptionPane.showInputDialog("Wat wil je zoeken?");
}
});
add(btnSearch);
我想用for循环。 但我不知道怎么做。 有人能帮我吗
# 1 楼答案
JTable的模型是存放数据的地方,通过搜索,您应该能够检查它是否包含您想要的内容 :
祝你好运