简体   繁体   English

如何在jTable中编辑和搜索数据(单词)?

[英]How to edit and search data (words) in jTable?

I am beginner in Java, only know basic stuff. 我是Java的初学者,只了解基本知识。

I would like to know how to edit and search data inserted to jTable ? 我想知道如何编辑和搜索插入到jTable数据? So like I type some data in textbox and added to jTable and then type in a search text box to find a specific word in jTable so it'll show up in jLabel . 因此,就像我在文本框中键入一些数据并将其添加到jTable ,然后在搜索文本框中键入以在jTable中查找特定单词jTable ,它将显示在jLabel

Then for editing, i don't even know how to do it. 然后进行编辑,我什至不知道该怎么做。 No idea. 不知道。 Plus, this all should be in a separate java class, not in .form (design) part in GUI. 另外,所有这些都应该放在单独的Java类中,而不是在GUI中的.form(设计)部分中。 A sample GUI Java application would be very much appreciated. 一个示例GUI Java应用程序将不胜感激。

Read the section from the Swing tutorial on How to Use Table for the basics of using tables. 阅读Swing教程中有关如何使用表的部分, 以获取使用表的基础知识。 There are sections on: 有以下部分:

  1. Concepts: Editor and Renderers
  2. Sorting and Filtering . Sorting and Filtering You might want to use filtering to search for a string. 您可能要使用过滤来搜索字符串。

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

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