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 is java util list?

489


What is the symbol for line break?

612


What is integer parseint?

553


What is bytecode in java ?

609


What is high level language in computer?

541






What is the basic concepts of OOPS?

693


What does g mean in regex?

567


Can list be final in java?

489


What is replaceall in java?

546


Do I need to import java.lang package any time? Why?

741


Can a class have 2 constructors?

502


What is the difference between static class and normal class?

494


How will you reverse a link list without using recursion?

599


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

600


What is equals method in java?

525