Java BasicStroke “Fuzzy”

后端 未结 1 1585
情话喂你
情话喂你 2020-12-11 22:33

I\'m trying to write a simple paint applet with Java, but I\'m having trouble with BasicStroke. Initially, my plan was to try to somehow draw a line with a wid

相关标签:
1条回答
  • 2020-12-11 22:48

    Don't forget the RenderingHints:

    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2d = (Graphics2D) g;
        g2d.setRenderingHint(
            RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
        ...
    }
    
    0 讨论(0)
提交回复
热议问题