Results 1 to 5 of 5
Thread: HTML linking and java applets
- 01-22-2009, 12:32 PM #1
Member
- Join Date
- Nov 2008
- Posts
- 40
- Rep Power
- 0
HTML linking and java applets
Is there a way to make a HTML link that if the user presses it, it would open a new window displaying an applet only? I seen some gaming websites that if you click on the link, a new window would open with just the game and none of the clutter the rest of a webpage would give.
- 01-22-2009, 09:22 PM #2
see JavaScript methods for controlling windows
- 01-26-2009, 08:34 PM #3
Member
- Join Date
- Nov 2008
- Posts
- 40
- Rep Power
- 0
I don't have a clue about JavaScript but i'll look into it, thanks.
- 02-08-2009, 03:02 AM #4
Member
- Join Date
- Feb 2009
- Posts
- 11
- Rep Power
- 0
Try this code to open a new window from an applet :
import java.applet.*;
import java.awt.*;
import java.net.*;
import java.awt.event.*;
public class testURL_NewWindow extends Applet implements ActionListener{
public void init(){
String link_Text = "google";
Button b = new Button(link_Text);
b.addActionListener(this);
add(b);
}
public void actionPerformed(ActionEvent ae){
//get the button label
Button source = (Button)ae.getSource();
String link = "...give any link.....";
try
{
AppletContext a = getAppletContext();
URL url = new URL(link);
a.showDocument(url,"_blank");
// a.showDocument(url,"_self");
// _self to open page in same window
}
catch (MalformedURLException e){
System.out.println(e.getMessage());
}
}
}
- 02-08-2009, 07:50 PM #5
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
Similar Threads
-
reading dir in java applets
By willemjav in forum Java AppletsReplies: 3Last Post: 02-07-2008, 12:36 AM -
Linking of exe files
By archu2friends in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-06-2008, 06:08 AM -
<URGENT> problem after linking .jnlp
By bongia in forum New To JavaReplies: 14Last Post: 11-18-2007, 05:57 PM -
Linking code to GUI Interface
By ai_2007 in forum Advanced JavaReplies: 1Last Post: 07-02-2007, 01:36 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks