• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cant get JDialog to display  RSS feed

 
Michael Gallacher
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a problem that I have been strugling with for the last few days and just cant sort it out. I have a program that has a main window when if a user clicks on a buton on that window a JDialog box should come up where a user can enter a date. Whenever I try to click on that button the outline of the JDialog comes up on screen with the window title and window buttons but there is nothing inside it. I have tryed just displaying the JDialog its self and everything comes up ok. I just cant get it to work when I click the button on the other window. I dont know what code is causing it so I have included the constructor for the JDialog.
 
Campbell Ritchie
Marshal
Posts: 55760
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

What dialog? I can’t see one anywhere, not even using ctrl-F! Have you shown us the correct bit of code?
 
Michael Gallacher
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I didnt make it clear the code i posted was the constructor for the JDialog, I've included more of the code below. Thanks for the quick reply.
 
Ryan Sykes
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't you also post the main program that invokes CalendarGUI, since that is what is likely causing the issue? If I understood you correctly, the CalendarGUI works and displays correctly when tested separately?
 
Michael Gallacher
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your correct it works perfectly when tested seperatly. the code that calls it is below
 
Campbell Ritchie
Marshal
Posts: 55760
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some bad design in that Listener class. Using getSource and equals is hardly object-oriented. You should use separate classes for different actions.

Look at these posts, and the old links in them: 1 2 3 You might get the same link twice!

I shall move this discussion to our GUIs forum.
 
Michael Gallacher
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick reply. Using getSource and equals came from couse text supplyed by my university so I thought it was OK, got a lot to learn. Thanks for the links.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!