/    Sign up×
Community /Pin to ProfileBookmark

use applet with javascript in textarea

+++++++++++++++++++++++APPLET+++++++++++++++++++++++++++
import java.applet.*;
import java.awt.*
;

public class Colors extends Applet{

Font f1;
public void init(){
f1=new Font(“Helvetica”, Font.BOLD+Font.ITALIC, 20);
}
public void paint(Graphics g){

g.setFont(f1);
g.setColor(Color.blue);
g.drawString(“FIRSTNAME”, 50, 100);
}

}
+++++++++++++++++++++++APPLET+++++++++++++++++++++++++++++

+++++++++++++++++++++JAVASCRIPT+++++++++++++++++++++++++
<HTML><HEAD>
<script type=”text/javascript”>
var nFirstName
function calc() {
df=document.myform;
df.add.onclick=function() {
nFirstName=df.firstname.value;
df.nResult.value= nFirstName
df.nResult.className=’vr’;
}
}
if(window.addEventListener){
window.addEventListener(‘load’,calc,false);
}
else {
if(window.attachEvent){
window.attachEvent(‘onload’,calc);
}
}
</script>
+++++++++++++++++++++++JAVASCRIPT++++++++++++++++++++++

++++++++++++++++++++++HTML+++++++++++++++++++++++++++++
</head>

<body>
<applet code=”Color.class”></applet>
<form action=”” name=”myform” method=”post” enctype=”text/plain” onSubmit=”document.myform.action = ‘maito:’ +document.myform.address.value”>
<DIV>
<center>FIRSTNAME:<input type=”text” name=”firstname”></center><br>
<label></label><textarea name=”nResult” cols=”60″ rows=”15″ readonly=”readonly”></textarea><br>
<input type=”button” name=”add” value=”result”>
<input type=”reset” name=”reset” value=”clear”>
</TABLE>
</div>
</form>

</body>
</html>
++++++++++++++++++++++++++++HTML+++++++++++++++++++++++
tHANKS FOR THE HELP. please this is what i need to do. I want to make the applet appear in the textarea at the front of the firstname.

to post a comment
Java

1 Comments(s)

×

Success!

Help @ken2010 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...