Pro Java 8 Programming by Spell Brett

Pro Java 8 Programming by Spell Brett

Author:Spell, Brett
Language: eng
Format: epub
ISBN: 978-1-4842-0642-3
Publisher: Apress
Published: 2015-05-26T16:00:00+00:00


Figure 7-26. A table with its rows sorted programmatically

Adding and Removing Table Rows

In all the examples you’ve seen so far, no JTable data was changed, added, or removed programmatically. However, you’ll sometimes want to dynamically change the data in a JTable after it’s displayed, and all that’s necessary is to make the changes to your TableModel and then notify its listeners (in other words, the JTable instance) that the data was modified.

For example, Listing 7-17 provides a simple one-column table and a text field that allows you to add lines of text to the table.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.