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 purpose of transferhandler class?
Name the method, to expand & collapse nodes in a Jtree?
What is swing and its features in java?
Which window contains the swing controls?
What is swing api?
Which types of components are used in designing swing based gui?
Hello Everyone.. I m trying to develop a java swing application where i can display a doc file Jeditorpane or Jtextpane.
What are the advantages of java swing over angular?
What is layout in java swing?
What is double buffering ?
Who created the swing?
What is the purpose of serialization in swings?