Answer Posted / chandra rekha
use the getGraphics method to get an object of the graphics
class and with that object we can perform draw methods.
for example
public class myclass extends...implements ActionListener
{
...
...
....
public void actionPerformed(ActionEvent ae)
{
if(ae==....)
{
Graphics g=getGraphics();
g.drawLine(100,200,150,250);
}
}
.....
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the swing components in java?
What is java swing components?
Why do we use swing in java?
Which method is used for setting security in applets?
What is the function of internal frame in swing?
What is swing and awt in java?
How to align components in java swing?
What is import javax swing?
What are the two key features of swing?
What is a swing day?
What is swing api?
Why are swings considered lightweight?
What are the advantages of swing?
What are the containers available in swing?
Is java swing a framework?