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 the class in swing to change the appearance of the frame in runtime?
What is jfc swing in java?
what do u mean by GUI framework
What are the differences between Swing and AWT?
What is meant by Swing?
How do you swing an applet?
What is difference between applet and swing?
Which window contains the swing controls?
I want to change the appearance of Frame in Runtime, what class can be used to do this?
how to give transparency for JComboBox,JListBox and JTable
Does Swing contains any heavy weight component?
What is an event handler in swing?