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 awt and swing?
Is swing an adjective?
Why would you use swingutilities.invokeandwait or swingutilities.invokelater?
What are the containers available in swing?
how to give transparency for JComboBox,JListBox and JTable
how can u handle runtime exceptions in java plz explain with examples briefly?
What's java swing?
How to link two forms in java swing?
How do you swing an applet?
what is difference between checked and unchecked exception plz explain examples ?
What are all the components used in Swing?
what are the root classes of all classes?