I am trying to learn to program Java after a layoff

J

jalexa9898

I am kind of rusty so what I have been doing is a simple program where
I try to put a label on an applet and a button that changes the text of
the label. I am using Sun Java Studio Creater but I am a tad confused
because I have not done a lot of Java in a while. Can someone give me
some idea as to how I make a button change the text of a label? I was
under the impression I use its onClick event but I have been unable to
get the software to access that event or rather method.
 
O

Oliver Wong

jalexa9898 said:
I am kind of rusty so what I have been doing is a simple program where
I try to put a label on an applet and a button that changes the text of
the label. I am using Sun Java Studio Creater but I am a tad confused
because I have not done a lot of Java in a while. Can someone give me
some idea as to how I make a button change the text of a label? I was
under the impression I use its onClick event but I have been unable to
get the software to access that event or rather method.

Assuming you're using the Swing API in your JApplet, see the following:

http://java.sun.com/docs/books/tutorial/uiswing/learn/example2.html#handlingEvents
http://java.sun.com/docs/books/tutorial/uiswing/events/index.html


- Oliver
 
D

David Segall

jalexa9898 said:
I am kind of rusty so what I have been doing is a simple program where
I try to put a label on an applet and a button that changes the text of
the label. I am using Sun Java Studio Creater but I am a tad confused
because I have not done a lot of Java in a while. Can someone give me
some idea as to how I make a button change the text of a label? I was
under the impression I use its onClick event but I have been unable to
get the software to access that event or rather method.
Java Studio Creator is intended for producing web based applications
where the user interacts with the application using a web browser like
Firefox, and the application runs on a "remote" server like the Sun
Application Server included with Creator. The GUI designer is creating
Java Server Faces pages _not_ applets.

If you want to create an applet download NetBeans from
<www.netbeans.org>. If you are rusty I suggest you start with a
desktop application instead of an applet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top