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 components of swing in java?
What are the advantages of java swing over angular?
What is swing api?
What is the use of double buffering in swings?
Can a class be it?s own event handler? Explain how to implement this?
Explain the difference between swing and jsf.
What is an event handler in swing?
What is the difference between applications and applets?
Why swing is used in java?
Why should the implementation of any swing callback (like a listener) execute quickly?
What are the containers available in swing?
What is import javax swing in java?
Is swing part of core java?
What is jfc swing in java?
What are the various components of swing?