Explain how to add a button in applet - Java

Explain how to add a button in applet.

The following are the steps to add a button in applet:

1. Declare and create the object of Button class - Button clickMe;
2. In the method ‘init()’, create the object of the button - clickMe = new Button(“Click Me”);
3. Use the ‘add()’ method – add(clickMe);
Explain the purpose of jar file - Java
A Jar file contains mostly .class files and optionally other files like sound files, image files for Java applications, gathered into a single file in the compressed format.....
Difference between String s="hello"; and String s=new String("hello"); in Java
The statement String s = “hello” is initialized to s and creates a single interned object....
Java vs. Javascript
The differences of Java and Java Script are: - Java can stand on its own where as Java Script mandatorily be placed within an HTML document.....
Post your comment