0

I try to show JDialog when I click JTable but my dialog didn't show.

It is my code :

private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {                                     
    if (evt.getButton() == MouseEvent.BUTTON1 && evt.getClickCount() == 2) {
       dlgCoba dlg = new dlgCoba();
       dlg.setVisible(true);
    }
}          
Ahmad
  • 22,657
  • 9
  • 52
  • 84
haidey
  • 37
  • 1
  • 4
  • Have you done any debugging? Does this event ever get triggered? – Hovercraft Full Of Eels Dec 05 '12 at 17:41
  • sometimes there are other properties that dont let you dialog be shown, for example it must be at front... – melli-182 Dec 05 '12 at 17:43
  • Please take care of 'Naming convention'. Your class name should be started with a capital letter. Can you post the code in 'dlgCoba' class. – Amarnath Dec 05 '12 at 17:47
  • @MatiasCaamaño: I don't understand what you are referring to. What do you mean by "it must be at front". Please clarify. Note, I'm not the original poster, and I feel that I understand Swing and JDialogs pretty well. – Hovercraft Full Of Eels Dec 05 '12 at 17:54
  • @HovercraftFullOfEels i mean that the Jdialog can be hidden by another component... – melli-182 Dec 05 '12 at 17:57
  • @MatiasCaamaño: I've never seen that happen, except perhaps rarely with mixing heavy and light weight components, but we don't see that here. In what situations do you mean? – Hovercraft Full Of Eels Dec 05 '12 at 17:59
  • 1
    I suspect that the cell is editable and is consuming the mouse event before it gets to you. If it's not required, make sure that the cells in question are not editable – MadProgrammer Dec 05 '12 at 21:27
  • the cell is not editable and when i click jTable the messagae error is "GroupLayout can only be used with one Container at a time" – haidey Dec 06 '12 at 00:00

0 Answers0