Forums Register Login

Help with two buttons on applet

+Pie Number of slices to send: Send
I have a program and i need a button that will show the lyrics to a song and the other button to clear those words from the text area and right now the way the program is set up is that when i click either of the buttons it shows the lyrics. How can i fix this?
+Pie Number of slices to send: Send
Hi Kinzur,
sorry but don't understand why you are able to compile it.
The if(ActionEvent == "Clear") statement should not work. Try actionEvent.getActionCommand() in the if statement.
Additional you need an else part. Otherwise you will clear the text box and fill it with lyrics again.
Regards
Torsten
+Pie Number of slices to send: Send
ok let me try that
+Pie Number of slices to send: Send
ok it works now but the output looks very funny on the applet. Like the text area over runs it or something and my buttons disappear once i click them.
+Pie Number of slices to send: Send
ok i got everything working accept when i run the program my buttons are on teh right of my text area and i want them at the bottom. how do i do that?
+Pie Number of slices to send: Send
Hi Kinzur,
if you would like to have the buttons on the bottom, I would use a Borderlayout and two additional JPanel.
For example:

Regards
Torsten
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1328 times.
Similar Threads
Help with this code
Arivazhagan
how to store data in multi dimenstional arrays
How do i use monitors?
Can someone help me out with this code
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:59:37.