简体   繁体   English

如何更新 jlist swing java

[英]How update a jlist swing java

在此处输入图片说明I had a problem.我有问题。 I am code a simple dictionary by using java swing I want first to show all word and then whẹn i type a word or first of a word , it wI'll display this sublist .我使用 java swing 编写了一个简单的字典,我想首先显示所有单词,然后 whẹn 我输入一个单词或单词的第一个,它会显示这个子列表。 I try much but not successful, may someone help me我尝试了很多但没有成功,有人可以帮助我

Instead of using a JList you could use a single column JTable .您可以使用单列JTable代替使用JList A JTable supports the ability to filter the rows of data in the table. JTable支持过滤表中数据行的能力。

Read the section from the Swing tutorial on Sorting and Filtering for a working example to get you started.阅读 Swing 教程中关于排序和过滤的部分,了解一个工作示例以帮助您入门。

You can even make the JTable look more like a JList by following these suggestions: How to create a JTable which appears as JList?您甚至可以按照以下建议使 JTable 看起来更像 JList: 如何创建显示为 JList 的 JTable?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM