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 |
What is Java Swing?
What is swing?
please any one explain this project: Minimizing recovery state in geographic ad hoc routing
What are all the components used in Swing?
What does x mean in javax.swing?
What are the components of swing?
Why are swing components called lightweight components?
Default layout for a ContentPane in JFC?
What is the use of jcomponent class in swing?
Why are swings considered lightweight?
What is the default look and feel of a Swing Component?
What are the swing components?