I have to delete a selected row in JTable using the Key Event. When I select a row and press the Delete Key, the selected row values should be deleted. How can I do this?
相关问题
- 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
You have to get the selected Rows (thats where the curser currently is) and then call removeRow on that rows.
I recommend you read the API for JTable.
try this (I used multiple rows in the code where I used it, but you should be able to break it down to one. Also, I'm unsure if the Arrays.sort is really necessary)