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 |
Difference between ligt weight and heavy weight?
can we create a object in static block class A { static { A a=new A(); } }
What is the use of jcomponent class in swing?
What is a component in swing?
What are the advantage of swing over awt?
What is swing in java javatpoint?
How are Swing and AWT be differentiated?
Hello ..Friends. I need a Code which makes a software of Enter the cheque Details.. means any enduser enter the details in a Particular field that should be printed on the paper On Cheque. at the backend side it sholud be printed on pdf file. Thanks in Advance
Why would you use swingutilities.invokeandwait or swingutilities.invokelater?
What are the advantages of swing over awt?
Which window contains the swing controls?
What is the difference between invokeAndWait() and invokeLater()?