/    Sign up×
Community /Pin to ProfileBookmark

Another Applet Question

If I created a class that had a method that returned a String, how can I get it to appear on the text box in an applet without showing an error? I know I have to create an object in the applet to call the method, but why does it show an error in the text box when I click on the button?

Someone please help.

Thanks,
Dan

to post a comment
Java

1 Comments(s)

Copy linkTweet thisAlerts:
@buntineFeb 13.2005 — Probably because your code is incorrect. ? Can you post the section that causes the error. And also the error message itself.

To set the text value of a TextField use:
<i>
</i>textFieldName.setText("Some text");
// Or to insert the value of a variable:
textFieldName.setText(variableName);

Regards.
×

Success!

Help @ItsOrreeeco 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.28,
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,
)...