I have a really weird problem. If I run this
applet as I copy below, the applet shows blank white screen. Then if I resize the window displaying the applet, I see a flicker of the Slider, or if I click on the Slider then it shows the slider correctly.
If I change the applet code by deleting the (blank) paint method, and leave everything else the same, the slider displays correctly with no issue.
The applet I am actually trying to make needs to have the paint method, so I can't just delete it. What can I do?
Code:
import java.applet.*;
import java.awt.*;
import javax.swing.*;
public class HelloWorldSWT extends Applet {
JSlider slider;
JPanel panel;
public void init(){
slider = new JSlider(JSlider.HORIZONTAL,1,10,5);
add(slider);
}
public void stop(){
}
public void paint(Graphics g){
}
}