• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Is it possible to popup a dialog from Applet?  RSS feed

 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be a wizard dialog. I'm afraid when the dialog pops up, I can't get data from the applet anymore, even I still hold the reference.
 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, applets can open dialogs or frames. Why do you think you can't get data from the applet if you open one?
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. But how to set the dialog's parent? According to JDialog's API, only Frame or Window can be its parent. In fact, the dialog is poped up from a JInternalFrame in the Applet. I can't find any containters in my applet to be dialog's parent.

If a dialog doesn't have a parent, it's not friendly to the user in some way. JOptionPane can let a general container(JPanel, JInternalFrame, etc) be its parent. But the dialog is restricted to MessageDialog, OptionDialog etc. I can't add my customized dialog into it.

Since 1.6, a new method JOptionPane.createDialog() seems to return a clean dialog which I can add my components into. I'm not sure.

:roll: It seems a Swing question.
 
Ulf Dittmer
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But how to set the dialog's parent?


Why do you need a parent? What's wrong with the no-argument constructor?

If a dialog doesn't have a parent, it's not friendly to the user in some way.


I don't understand what this means. How is it not user-friendly? Why would the user care about this?
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for you reply.

1 The dialog's position is relatively to its parent. Although I can use some Utiliy method to do this, but it's more natural if it has a parent.

2 If a dialog has no parent it will disappear when user cliking anohter window or application. In MS Windows, you need to use Alt + Tab to popup the dialog out. That's the non-user-friendly I said.
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!