Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic