Trying to draw lines with JPanel
问题 I am trying to draw lines using JPanel and I have hit somewhat of a wall. I can get two sides down but once it comes to subtracting from the x cord it all goes wrong. package GUIstuff; import java.awt.Graphics; import javax.swing.JPanel; public class DrawPanel extends JPanel{ public void paintComponent (Graphics g){ super.paintComponent(g); int width = getWidth(); int height = getHeight(); int drawCounter = 0; // counters for all the while statements int drawCounter2 = 0; int drawCounter3 = 0