Hey guys, sorry I didn't post for long. Now here I am, with a new issue. Here is my code:-
import java.applet.*;
import java.awt.*;
import javax.swing.JFrame;
public class HelloWorld extends JFrame
{
public HelloWorld() {
setVisible(true);
setResizable(false);
setSize(300, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void paint (Graphics g)
{
g.drawString("Hello World!", 50, 25);
}
public static void main(String[] args) {
new HelloWorld();
}
}
The string displays, but the window is transparent. Why and how to solve it?