Are there any methods that are used to get the data of the selected row? I just want to simply click a specific row with data on it and click a button that will print the data in the Console.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
if you want to get the data in the entire row, you can use this combination below
Where "tableModel" is the model for the table that can be accessed like so
this will return the entire row data.
I hope this helps somebody
using from
ListSelectionModel
:see here.
You can use the following code to get the value of the first column of the selected row of your table.
http://docs.oracle.com/javase/7/docs/api/javax/swing/JTable.html
You will find these methods in it:
Use a mix of these to achieve your result.