Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JButton in Applet triggers HTML  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering if it was possible to trigger HTML using a JButton. Here is what I mean.
I have 2 frames in my HTML and in Frame 1 I have an applet loaded that is a series of JButtons. When I press one of those buttons, I want to load a web page inside of Frame 2.
I know I can do this with standard HTML forms, but I would like to know if you can do it using an Applet and JButtons.
If this needs to be moved to the HTML forum, please move it.
Thanks.
 
Omar IRAQI
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Greg,
You can achieve this using the AppletContext, meaning that you can ask the browser that runs the applet to do it for u.
Here is a sample code :
AppletContext theAppletContext = theApplet.getAppletContext();
theAppletContext.showDocument(documentURL, targetFrame);
Regards
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!