Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can you draw using Swing components?

Answer Posted / chandra rekha

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you swing an applet?

1086


Is java swing a framework?

1035


What is swing package in java?

968


Can a class be it?s own event handler? Explain how to implement this?

990


what are the steps required in creating an empty table drop?

1045


What is the purpose of serialization in swings?

1006


Is java swing still used?

997


What are the components of java swing?

1010


When we should go for codebase in applet?

1069


Why are swing components called lightweight?

981


What is the what is the difference between invokeandwait() and invokelater()? ?

1097


What is the process of setting the layout manager?

1052


What is swing delegation event model in java?

1092


What are heavyweight components? What is lightweight component?

981


What is the use of swing in java?

1060