..""
EXTRA:
Ta en titt på Ludde, Min snygga kompis.
...ja tjejjer
HAN
ÄR SINGEL!!
maila
honom idag. ta med honom hem redan ikväll!
kolla på kontakt i
sidmenyn
/*****************************************************************************/
/* */
/* FILE NAME: Password.java */
/* AUTHOR: Jonny Zetterstrom, jonny.zetterstrom@ludvika.net */
/* COPYRIGHT: (C) 1999, Jonny Zetterström */
/* */
/* DESCRIPTION: This is an applet you can use to hide parts of your home- */
/* page. Instead of an ordinary link to the secret part you */
/* use this applet. If the correct password is entered this */
/* applet will take the visitor to the secret page. */
/* To improve security a bit this applet uses no para- */
/* meters; you will have to alter the constants in the code */
/* yourself. This prevents your visitor from finding the */
/* secret area just by examining the HTML-source code. */
/* */
/* The reason why I wrote this applet was because I had */
/* found a similar one on the net. That applet was shareware */
/* and to use it you had to pay $25. This applet is free! */
/* */
/* If you have any comments or questions feel free to e-mail. */
/* */
/*****************************************************************************/
//Import classes to prevent the lazy programmer from typing too much
import java.applet.*;
import java.awt.*;
import java.net.*;
public class Password extends Applet {
//Declare the global variables
URL url;
String password;
Button OKButton;
TextField InputField;
Label label;
//Method init() initializes the applet. This is done only once!
public void init(){
try {
/*****************************************************************************/
/* */
/* REPLACE */
/* */
/* Replace "http://www.altavista.com/" with your "secret" URL. */
/* */
/*****************************************************************************/
url = new URL("members.xoom.com/groonis/tren.htm");
}
catch (MalformedURLException ex) {
showStatus("The URL is incorrect: " + url.toString());
}
/*****************************************************************************/
/* */
/* REPLACE */
/* */
/* Replace "password" with your own secret password. */
/* */
/*****************************************************************************/
password = "gronisrox";
setBackground(Color.black);
setForeground(Color.white);
setFont(new Font("Dialog",Font.BOLD, 12));
label = new Label("Password:");
InputField = new TextField(10);
InputField.setEchoCharacter('*');
OKButton = new Button("OK");
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
setLayout(gridbag);
gbc.gridx=0;
gbc.gridy=0;
gridbag.setConstraints(label, gbc);
gbc.gridx=1;
gbc.gridy=0;
gridbag.setConstraints(InputField, gbc);
gbc.gridx=2;
gbc.gridy=0;
gridbag.setConstraints(OKButton, gbc);
add(label);
add(InputField);
add(OKButton);
};
//Method start is called everytime the applet is started. It erases possible earlier tries.
public void start(){
InputField.setText("");
}
//Method action responds to a click on the OK-button.
public boolean action(Event evt, Object what){
String txt;
if (evt.target == OKButton){
showStatus("");
txt=InputField.getText();
if (txt.equals(password)){
showStatus("Correct password");
correct();
}
else {
showStatus("Invalid password");
InputField.setText("");
}
return true;
}
else
return false;
}
//This method tells the browser to open the document at the secret URL.
public void correct() {
this.getAppletContext().showDocument(url);
}
}