How to restrict user from clicking or continue working with the applet when a dialog box is thrown to him
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, October 29, 2001 09:06 PM

Problem is , i throw a help dialog box on click of a button on an applet, the user is supossed to choose a option from the dialog box and click OK (or) Cancel, but if the user clcks the applet which lays below the dialog box directly the dialog box just goes back of the browser, which should not happen.




I want my dialog box to remain and restrict the user from accessing the applet till he either presses OK (or) Cancel.





for person who know VB, i need the dialog box functioning as the same as VB's Model Dailog Box

Re: How to restrict user from clicking or continue working with the applet when a dialog box is thrown to him

Posted By:   sam_pitroda  
Posted On:   Wednesday, October 31, 2001 10:19 AM

note that JDialog has a couple of constructors and one takes two parameters.

1. parent frame,
2. a boolean for modal

When you launch your dialog from applet,
use:


yourDialog = new YourDialog((JOptionPane.getFrameForComponent(this), true );

this will make it modal.

Re: How to restrict user from clicking or continue working with the applet when a dialog box is thrown to him

Posted By:   sam_pitroda  
Posted On:   Wednesday, October 31, 2001 10:19 AM

note that JDialog has a couple of constructors and one takes two parameters.

1. parent frame,
2. a boolean for modal

When you launch your dialog from applet,
use:


yourDialog = new YourDialog((JOptionPane.getFrameForComponent(this), true );

this will make it modal.

Re: How to restrict user from clicking or continue working with the applet when a dialog box is thrown to him

Posted By:   John_Zukowski  
Posted On:   Monday, October 29, 2001 10:11 PM

Dealing with Modal dialogs is already covered in the FAQs.
About | Sitemap | Contact