How can you draw using Swing components?
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 |
Write a program to paint the off-screen buffer in swings
What class is at the top of the AWT event hierarchy?
What are swing components in java?
What is the base class for all swing components?
What is an on stage swing?
What is the difference between AWT & Swing?
21 Answers BeBo Technologies, Deshaw, TCS,
What is the corresponding Layout for Card in Swing?
Why swings are called lightweight components?
What is java swing application?
What is pane in swing?
How to reload a jframe in java swing?
What is the purpose of transferhandler class?