You can use Netscape's LiveConnect
(http://developer.netscape
to call a javascript from your applet.
with this you can change the url of your doc and this moves down the doc without reloading the page.
Here is the applet code:
package programs;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import netscape.javascript.*;
public class CallJavaScriptApplet extends Applet {
Applet _applet=null;
//Initialize the applet
public void init() {
System.out.println("Applet
_applet=this;
final Label _label=new Label("Move over me");
_label.setBackground(Color
_label.setForeground(Color
setLayout(new FlowLayout());
add(_label);
_label.addMouseListener(ne
public void mouseEntered(MouseEvent e){
_label.setBackground(Color
_label.repaint();
}
public void mouseExited(MouseEvent e){
_label.setBackground(Color
_label.repaint();
}
public void mouseClicked(MouseEvent e){
JSObject win = JSObject.getWindow(_applet
win.eval("document.URL=\""
}
});
}
public void start(){
System.out.println("Applet
}
public void stop(){
System.out.println("Applet
}
}
Here is the HTML Code:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>
HTML Test Page
</TITLE>
</HEAD>
<BODY>
programs.CallJavaScriptApp
<APPLET
CODEBASE = "."
CODE = "programs.CallJavaScriptAp
NAME = "TestApplet"
WIDTH = 400
HEIGHT = 150
HSPACE = 0
VSPACE = 0
ALIGN = middle
MAYSCRIPT
>
</APPLET>
<p><A HREF="javascript:history.g
<p>Lorem ipsum dolor' is the first part of a nonsense paragraph sometimes used to demonstrate a font. It has been well established that if you write anything as a sample, people will spend more time reading the copy than looking at the font. The ``gibberish'' below is sufficiently like ordinary text to demonstrate a font but doesn't distract the reader. Hopefully.
<p>Rick Pali submits the following from Before and After Magazine, Volume 4 Number 2.:
<p>[quote]
<p>After telling everyone that Lorem ipsum, the nonsensical text that comes with PageMaker, only looks like Latin but actually says nothing, I heard from Richard McClintock, publication director at the Hampden-Sydney College in Virginia, who had enlightening news:
<p>"Lorem ipsum is latin, slightly jumbled, the remnants of a passage from Cicero's _de Finibus_ 1.10.32, which begins 'Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...' [There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain.]. [de Finibus Bonorum et Malorum, written in 45 BC, is a treatise on the theory of ethics very popular in the Renaisance.]
<p>"What I find remarkable is that this text has been the industry's standard dummy text ever since some printed in the 1500s took a galley of type and scambled it to make a type specemin book; it has survived not only four centuries of letter-by-letter resetting but even the leap into electronic typesetting, essentially unchanged except for an occational 'ing' or 'y' thrown in. It's ironic that when the then-understood Latin was scrambled, it became as incomprehensible as Greek; the phrase 'it's Greek to me' and 'greeking' have common semantic roots!"
<p>[unquote]
<p>
One Example of Lorem Ipsum Dolor
<p>Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Et harumd und lookum like Greek to me, dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda. Et tam neque pecun modut est neque nonor et imper ned libidig met, consectetur adipiscing elit, sed ut labore et dolore magna aliquam makes one wonder who would ever read this stuff? Bis nostrud exercitation ullam mmodo consequet. Duis aute in voluptate velit esse cillum dolore eu fugiat nulla pariatur. At vver eos et accusam dignissum qui blandit est praesent luptatum delenit aigue excepteur sint occae. Et harumd dereud facilis est er expedit distinct. Nam libe soluta nobis eligent optio est congue nihil impedit doming id Lorem ipsum dolor sit amet, consectetur adipiscing elit, set eiusmod tempor incidunt et labore et dolore magna aliquam. Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incommod quae egen ium improb fugiend. Officia deserunt mollit anim id est laborum Et harumd dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda et tam. Neque pecun modut est neque nonor et imper ned libidig met, consectetur adipiscing
<a name="end"></a>
</BODY>
</HTML>
To test whether the page gets reloaded I have System.out's in the applet's init, start and stop methods. unlike the reload fucntion, when you move down the page the applet is neither stopped, started or inited.
hope this helps,
-sgoms
Main Topics
Browse All Topics





by: sgomsPosted on 2001-02-08 at 08:58:38ID: 5824598
The java event that corresponds to 'onMouseOver' would be
public void mouseEntered(MouseEvent e){} under MouseListener.