1.what is the exact difference between applet and frame?

2.Do we use main method in frames?

Answer Posted / amarnath88888

I think you are trying to ask difference between applet
window and frame.

If window it is already present there if you extend Applet
class to your class. You can create the components inside
the window and no need to write the code in main() method.
Its enough to write in init() or paint() method.

If it is a Frame then you need to extend Frame class to your
class. Then you can place the components inside frame. But
you need to include setSize(x,y) for setting the size of the
frame and setVisible(true) for displaying the frame in the
window.
And you need to write main() method also. there you need to
create object for frame class which you have created and
call the methods to display the frame.

Is This Answer Correct ?    26 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are kinds of processors?

575


why Interface used?

541


What are the three parts of a lambda expression?

538


What is a functional interface?

549


How do you identify independent and dependent variables?

509






What are the features in java?

580


What class allows you to read objects directly from a stream in java programming?

518


Can we extend singleton class?

535


Is math class static in java?

618


Explain the difference between call by refrence and call by value?

568


How do you override a private method in java?

509


Do extraneous variables affect validity?

528


What are the access modifiers in java?

591


Where are the card layouts used?

616


What is foreach loop in java?

538