I am trying to make the JLabel
(point) to move location. It isn't working and when I add frame.setLayout(null)
I just get a blank dark screen.
JFrame frame = new JFrame( "That snake game");
frame.setLayout(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel point = new JLabel("|eat this|");
point.setForeground(Color.blue);
frame.getContentPane().add(point);
frame.getContentPane().setBackground(new Color(0,3,0));
frame.setSize(400, 400);
point.setLocation(340, 34);
frame.setVisible(true);
How can I make the JLabel (point) to move location?