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 Java Swing?
Is java swing still used?
How to render an html page using only swing.
Which swing methods are thread-safe?
What is java swing used for?
What is difference between applet and swing?
Can a class be it?s own event handler? Explain how to implement this?
What are the swing components?
Is swing thread-safe?
What are the components of swing in java?
What is swing and its features in java?
Why swing is used in java?
What is swing control?
How does accessibility works in swings?
How to align components in java swing?