Valeu luke_saluti, mas não rolou, fiz um exemplo meio tonto pra vcs verem e tentar me ajudar, nunca mexi com applet, só quero fazer um teste para quebrar um galho em uma necessidade aqui.
// Codigo do applet
import javax.swing.JApplet;
public class testeApplet extends JApplet {
public String getWhatever(String query){
if (query.equals(“teste”)){
return “OK”;
} else {
return “NOK”;
}
}
}
No html to colocando isso:
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<script type=“text/javascript”>
function chama(){
alert(document.ap.getWhatever(“teste”)); }
</script>
<meta content=“text/html; charset=ISO-8859-1” http-equiv=“content-type”>
<title>Teste Applet</title>
</head>
<body>
<applet name=“ap” id=“ap” codebase=“applet” archive=“testeApplet.class” code=“testeApplet.class” height=“100” width=“100”> </applet>
<button value=“A” name=“A” onclick=“chama()”></button>
</body>
</html>
Ta bem simplorio, só quero fazer um teste mesmo.
Obrigado!