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 is layout in java swing?
Why are swings considered lightweight?
What are swing components?
What is the process of setting the layout manager?
What is the use of java swing?
What are the components of swing in java?
Which is better swing or awt?
Why would you use swingutilities.invokeandwait or swingutilities.invokelater?
What is the difference between swing and awt in java?
Why should any swing call back implementation execute quickly?
How to add calendar in java swing using eclipse?
Why swing is used in java?
What is the use of double buffering in swings?
Which method is used for setting security in applets?
What is an event handler in swing?