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

Write a program to include the internal frame in swing.

0 Answers  


Which method is used by the applet to recognize the height and width?

0 Answers  


What are the components of java swing?

0 Answers  


What are the advantages of swing?

0 Answers  


How to add calendar in java swing using eclipse?

0 Answers  


How to create a swing gui in java?

0 Answers  


What is the base class for all of swing components?

11 Answers   Infosys,


Difference between AWT and Swing compenents?

3 Answers  


What are the different components that are used to show a container?

0 Answers  


Is java swing deprecated?

0 Answers  


What is the mean of swing?

0 Answers  


Which method of the Component class is used to set the position and size of a component?

0 Answers  


Categories