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
Hello Everyone.. I m trying to develop a java swing application where i can display a doc file Jeditorpane or Jtextpane.
What is the difference between a scrollbar and a jscrollpane ?
Is java swing deprecated?
What are the components of swing in java?
What is swing control?
Why should any swing call back implementation execute quickly?
What does javax swing do?
What is swing used for?
Explain how to render an html page using only swing.
Is swing an api?
Which method is used for setting security in applets?
Write a program to paint the off-screen buffer in swings
What is java swing used for?
How is parsing html used in swing?
What is swing in java javatpoint?