|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Nov 2004
Messaggi: 691
|
JButton in JTable, problema con ActionEvent
Quoto una descrizione di un pezzi di codice che ho preso in giro:
At this point, you're almost done, but not quite. What's the use of putting a JButton in a JTable if you can't press the darn thing? By default, JTable will not forward mouse events to components contained in its cells. If you want to be able to press the buttons you add to JTable, you have to create your own MouseListener that forwards events to the JButton cells. JTableButtonMouseListener demonstrates how you could do this. Premesso che i JButton non inseriti nella JTable funzionano, quelli nella JTable no. Da quanto ne evinco dal quote, il metodo che ho preso serve a passare un mouseEvent dalla cella della JTable al component in essa contenuto, quindi passa un mouseHover o mouseClicked al component, il bottone stesso, e poi però?... Come innesco il classico ActionEvent dei bottoni NON contenuti in JFrame? Grazie a tutti, TD |
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 05:32.


















