| Author |
String is not displaying in the panel...
|
Shalini Chandel
Ranch Hand
Joined: May 05, 2005
Posts: 115
|
|
Hi all, I made an applet with a panel and one button on it. I want to display a string inside the panel on the click event of the button. Now the problem is when i click the button, the string is dispalying on the applet. How can we redirect it to the panel. The code is as follows: Its very urgent..Somebody please help me.. thanx and regards....
|
SCJP 1.4
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
Remove paint() method from Applet And add one class as Class pan extends Panel{ }
|
Lack of will power has caused more failure than lack of intelligence or ability.
My Blog | Red5 Resources | Technology Update | Daily Technology Tips
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
Remove paint() method from Applet And add one class as Class pan extends Panel{ public void paint(Graphics g){ g.drawString("Whatever", locX, locY); } } Now call pan.repaint() in actionPerformed() as u already did Tell me If i m not clear to my point
|
 |
Shalini Chandel
Ranch Hand
Joined: May 05, 2005
Posts: 115
|
|
Thanx a lot Sunil.... It's done...
|
 |
 |
|
|
subject: String is not displaying in the panel...
|
|
|