0
Hi everyone ! Please I don't know why this line is not working in my code :
JFrame jf = new JFrame()
4 Answers
0
Did you imported library ?
not working means how behaving?
0
Yes, of course !đ
import javax.swing.JFrame;
0
import javax.swing.JFrame;
public class Program
{
public static void main(String[] args) {
JFrame jf = new JFrame();
jf.setTitle("Animation");
jf.setSize(20,20);
jf.setLocationRelativeTo(null);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.setVisible(true);
}
}
0
Increase size
jf.setSize(200, 300);
Add something to frame.
JLabel l = new JLabel("New Label");
jf.add(l);
try to add a panel
and now see...