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 are swings awt?
What is java swing application?
What are the differences between Swing and AWT?
how to give transparency for JComboBox,JListBox and JTable
What is swing in java javatpoint?
What is the default look and feel of a Swing Component?
Explain the below Statement if(ae.getSource()==b1)
What is meant by JFC?
Is swing still used in java?
Why swing is better than awt?
What is container in java swing?
Name the borders provided by Swing?