I know how to do event listener with mouse. But I have difficulty to create key stroke listener.
I have a swing table, that when multiple rows are selected. I wanna disable a button. But users can still select multiple rows by using shift+up or shift+down.
How is the event for this kind of key stroke to be create?
If you want something to happen to your GUI when a certain selection event takes place, then just use a selection listener. Don't waste your time writing picky-picky code which looks for mouse clicks and tries to figure out what row was clicked on and then what that meant in terms of rows selected. The component does all of that for you already.