简体   繁体   中英

Scroll to Top inside the browser using Java Applet

I can not figure this one out. Is there anyway Java Applet can scroll the webpage that it's displayed to Top?

I am Not talking about the scroll bar inside the Java Applet, I'm talking about browser's scroll bar.

let's say I have very tall applet. so browser has a scrollbar on the side to scroll down to bottom of the applet.

in the bottom, there's a button to click "Back To Top".

How do I make that button work? Mind you that there is No scrollbar within the applet.

Thanks

It is possible to call javascript code from within your applet. Thus create a jscript method which scrolls to the top and call it from your java code.

More infos here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM