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
How do you swing an applet?
Is java swing a framework?
What is swing package in java?
Can a class be it?s own event handler? Explain how to implement this?
what are the steps required in creating an empty table drop?
What is the purpose of serialization in swings?
Is java swing still used?
What are the components of java swing?
When we should go for codebase in applet?
Why are swing components called lightweight?
What is the what is the difference between invokeandwait() and invokelater()? ?
What is the process of setting the layout manager?
What is swing delegation event model in java?
What are heavyweight components? What is lightweight component?
What is the use of swing in java?