Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个提供 GUI 的简单文件搜索程序。ActionListener它运行良好,但是,当我更新输出时,我在搜索按钮中收到编译时间警告JList。有没有办法避免这个警告?
ActionListener
JList
从 Java 7 开始,该类JList就支持泛型。当它们丢失时,编译器会抱怨。您可以使用
JList<String> resultList = new JList<>();