• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Cant get JDialog to display

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 80254
428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your correct it works perfectly when tested seperatly. the code that calls it is below
 
Campbell Ritchie
Marshal
Posts: 80254
428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic