Write a complete Java applet that displays the phrase “Welcome to my world!” in the center of the applet.
What will be an ideal response?
```
import javax.swing.JApplet;
import javax.swing.JLabel;
import java.awt.Container;
import java.awt.BorderLayout;
public class myApplet extends JApplet
{
public void init()
{
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
JLabel label = new JLabel("Welcome to my world!");
contentPane.add(label, BorderLayout.CENTER);
}
}
```
Computer Science & Information Technology