• 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

Is it possible to popup a dialog from Applet?

 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic