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

How do you achieve polymorphism in java?

716


What is the purpose of the runtime class in java programming?

789


What does a method signature consist of?

718


What is ellipsis in java?

813


What value is a variable of the string type automatically initialized?

824


What is getclass () getname () in java?

881


What is update method called?

874


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

827


What is difference between array and arraylist in java?

693


why Interface used?

733


Is java call by value?

817


How is it possible in java programming for two string objects with identical values not to be equal under the == operator?

768


What is charat ()?

718


What are the differences between forwarding () method and sendredirect() methods?

832


What is the use of arraylist in java?

777