Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDialog with JApplet parent

 
Nigel Patching
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to have a JDialog appear in an JApplet, but have the JApplet as the parent frame to the JDialog.
Unfortunately JApplet is a super class to Frame / JFrame. I've tried casting it to Frame but (predictably) this gave me a runtime error.
Of course I could have no parent for the JDialog, but I would prefer the functionality you get when the JDialog has a parent.
Anyone got any ideas how I can do this?
Thanks,
NIgel
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nigel,
I would create a frame but don't make it visible and use as the parent of the dialog.

Regards,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic