• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Close Dialog Box(Urgent!)

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have initiated Dialog which has owner frame. I have two buttons called "Retry" and "Cancel" in dialog box.
When I click, on "Cancel", it will close the dialog box by using method hide().
There is close (x) at right upperhand corner. It is not operative right now. How to get operative (x) button, so when user click on that (x), it must close dialog box.
Plz explain me by simple example...
Thanks in advance,
Angela
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The solution is to add an event listener to your dialog box. Here's an example:
Dialog yourBox = new Dialog();
yourBox.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
yourBox.hide();
}
});
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Buckley,
I want to know,if modal state is true, you can not close dialog box. Am I right?
Thanks
Angela
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The difference between Modal & Modeless windows is that, when a Modal window is opened, you cannot go to any other window in the application till you close it. With modeless, you can open any number of modeless windows, switch between them and use them parallely. I don't think there's any other difference.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic