Article View: es.comp.os.linux.programacion
Article #12436[OT] Re: Duda con hipervinculo en applet Java
From: Gonzalo Paniagua Javier
Date: Tue, 10 Jul 2001 08:21
Date: Tue, 10 Jul 2001 08:21
81 lines
3781 bytes
3781 bytes
Dragoncet <suslab@[nospam]ono.com> escribi�:
> �Alguna sugerencia?
�Quieres algo como esto?
import java.awt.*;
import java.applet.*;
import java.net.*;
public class AppGetURL extends Applet {
URL getUrlName = null;
void buttonGetUrl_Clicked(Event event) {
try {
getUrlName=new URL(textFieldUrl.getText());
getAppletContext().showDocument(getUrlName, "_top");
} catch(Exception e) {
label2.setText("No puedor abrir esa peazo URL : "+textFieldUrl.getText());
label2.reshape(9,67,313,15);
label2.show(); }
}
void buttonSource_Clicked(Event event) {
try {
getUrlName=new URL("http://www.tel.uva.es/~gpanjav/AppGetURL.java");
getAppletContext().showDocument(getUrlName, "_top");
} catch(Exception e) {
label2.setText("No puedor abrir el fuente : "+textFieldUrl.getText());
label2.reshape(9,67,313,15);
label2.show(); }
}
public void init() {
super.init();
setLayout(null);
addNotify();
resize(434,89);
textFieldUrl = new java.awt.TextField();
textFieldUrl.reshape(4,30,322,24);
textFieldUrl.setText("http://www.abaforum.es/users/303/userc1.htm");
add(textFieldUrl);
buttonGetUrl = new java.awt.Button("Get");
buttonGetUrl.reshape(336,29,89,25);
add(buttonGetUrl);
buttonSource = new java.awt.Button("Ver el fuente");
buttonSource.reshape(436,29,89,25);
add(buttonSource);
label1 = new java.awt.Label("Pon la URL y dale a 'Get'");
label1.reshape(42,8,200,15);
add(label1);
label2 = new java.awt.Label("label");
label2.hide();
label2.reshape(9,67,47,15);
add(label2);
}
public boolean handleEvent(Event event) {
if (event.target == buttonGetUrl && event.id == Event.ACTION_EVENT) {
buttonGetUrl_Clicked(event);
}
if (event.target == buttonSource && event.id == Event.ACTION_EVENT) {
buttonSource_Clicked(event);
}
return super.handleEvent(event);
}
java.awt.TextField textFieldUrl;
java.awt.Button buttonGetUrl, buttonSource;
java.awt.Label label1;
java.awt.Label label2;
}
--------
Emacs is a nice OS - but it lacks a good text editor.
That's why I am using Vim.
Anonymous
--------
Technical Details
Message-ID:
<5tedi9.cb1.ln@lalo.micasa>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!newsfeed.online.be!ams.uu.net!newsf01.!newsr01.ono.com.POSTED!not-for-mailReferences:
<9icvnm$3ba$2@kenobi.antakira.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f86c8,3f5a5c69f0a68bef
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2001-07-10 01:21:42 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!newsfeed.online.be!ams.uu.net!newsf01.!newsr01.ono.com.POSTED!not-for-mail
From: Gonzalo Paniagua Javier <gpanjav@jazzfree.com>
Subject: [OT] Re: Duda con hipervinculo en applet Java
Newsgroups: es.comp.os.linux.programacion
References: <9icvnm$3ba$2@kenobi.antakira.com>
User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (Linux/2.4.5-ac7 (i586))
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <5tedi9.cb1.ln@lalo.micasa>
Lines: 82
Date: Tue, 10 Jul 2001 08:21:59 GMT
NNTP-Posting-Host: 62.42.14.67
X-Trace: newsr01.ono.com 994753319 62.42.14.67 (Tue, 10 Jul 2001 10:21:59 MET DST)
NNTP-Posting-Date: Tue, 10 Jul 2001 10:21:59 MET DST