public class Points extends JPanel {
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.drawLine(60, 20, 80, 90);
}
}
I'm not really sure what's the Graphics2D g2d = (Graphics2D) g;
supposed to do.
It's just a plain JPanel that's later added onto a JFrame.
It would be really helpfull if anyone could give me some advice as I'm stuck at this line of the code for a long time now.