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?



How can you draw using Swing components?..

Answer / 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

More Swing Interview Questions

Why should any swing call back implementation execute quickly?

0 Answers  


What is java swing application?

0 Answers  


What is the purpose of action interface in swing?

0 Answers  


What is swing in java with example?

0 Answers  


Name the method, to expand & collapse nodes in a Jtree?

1 Answers   Wipro,


What is swing package in java?

0 Answers  


How to move from one page to another in java swing?

0 Answers  


What are the benefits of using Swing over AWT?

5 Answers  


Which swing methods are thread-safe?

0 Answers  


Where is java swing used?

0 Answers  


What are the differences between Swing and AWT?

0 Answers  


What is a component in swing?

0 Answers  


Categories