• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GUI: problems with window not closed on dispose() - please help

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

as a "Swing newbie" I have serious problems with the GUI. For the details, I lean very much on the Monkhouse book, whereas for the overall design I tried to follow the Supervising Controller (or Supervising Presenter) pattern I learned about from Koskela's "Test driven" book. This means I have all action listeners in the controllers and just the pure layout in the view.

So when I start the application, I create a ConfigController, which tells the EventQueue to create the view, which opens a dialog for the confguration info. Then when the user clicks "connect", inside the ConfigController I create a new Controller, BookingController, which creates "his" view... But I cannot get the configuration window to disappear, even though I call dispose() on the view:



The configuration window just loses focus (when the table opens) and when you click it, you see it as a small distorted thing in the left corner. Does anyone perhaps have an idea what is happening here? I am hanging quite some time now with the GUI things and find them somehow much more difficult to approach than the rest

Thanks a lot in advance
Sigrid
 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a guess here, but try and Not sure how you declared view but my GUI extends JFrame.
 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anne,

thanks a lot for your answer! In fact I had both these lines in the code, but due to your suggestions I found the mistake: I was setting two "things" visible, the view and its child component, a JDialog.
(This was because inexperienced with Swing as I am, I first just set the view (a JFrame) itself visible and not the dialog, which did not work out.)
Now I have just the dialog set visible, and it seems to work fine.

Thanks again
Sigrid
 
reply
    Bookmark Topic Watch Topic
  • New Topic