I have created a testing version to simplify the problem that I'm having for you guys:
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class Test extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
JLabel l = new JLabel("hello");
JPanel cp;
public Test(){
setContentPane(cp = new JPanel());
cp.add(l);
setSize(200, 200);
setVisible(true);
}
public void paint(Graphics g){
//do absolutely nothing
}
}
When you start up the program, you get to see a perfectly blank window. However, if you remove the paint method, the JLabel shows up! (I've had to search for this bug for ages, really). Now, how can I enable a window to both use graphics and regularly draw components? Thanks in advance