Michael Dunn wrote:that snippet works OK for me - clicking a cell highlights the row, and puts focus border around cell.
unless you're talking about edit mode - that requires the extra click.
Michael Dunn wrote:sorry, but I'll read it here, not at youtube.
i.e. post the code here
Michael Dunn wrote:before you go any further, dump mouseClicked() - it doesn't always fire.
Michael Dunn wrote:> Do I enter all the logics into the mousePressed Event handler?
most times mousePressed() is the best choice, however, there are times
when mouseReleased() will be better - just a matter of testing.
luck, db
There are no new questions, but there may be new answers.
Tony Docherty wrote:If using just mouseReleased does the user really want the program respond to the event if say they have pressed the mouse button on another component, decided they didn't want to click there so moved the mouse over the JTable and released the button.
luck, db
There are no new questions, but there may be new answers.
Darryl Burke wrote:
Tony Docherty wrote:If using just mouseReleased does the user really want the program respond to the event if say they have pressed the mouse button on another component, decided they didn't want to click there so moved the mouse over the JTable and released the button.
That doesn't trigger a MouseListener added to the table. mouseReleased events are generated for the component over which the mouse was pressed.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |