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 |
Why should the implementation of any swing callback (like a listener) execute quickly?
What is container in java swing?
What are the benefits if Swing over AWT?
What are the advantages of swing over awt?
What is the difference between swing and applet?
What is the use of java swing?
What is sling swing?
can we create a object in static block class A { static { A a=new A(); } }
What things to do to make a web browser compatibale for swing components?
1 Answers Tesco, TracFone, Wipro,
What are the swing components?
What is swing container?
Is swing an api?