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 include the internal frame in swing.
Which method is used by the applet to recognize the height and width?
What are the components of java swing?
What are the advantages of swing?
How to add calendar in java swing using eclipse?
How to create a swing gui in java?
What is the base class for all of swing components?
Difference between AWT and Swing compenents?
What are the different components that are used to show a container?
Is java swing deprecated?
What is the mean of swing?
Which method of the Component class is used to set the position and size of a component?