title: I am trying to draw the line in the middle. I tried different coordinates
body: <p><a href="https://i.stack.imgur.com/5lrIq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5lrIq.jpg" alt="enter image description here"></a>Here is my paintComponent which contains the coordinates</p>
  
  <pre><code>public void paintComponent(Graphics g) {
          super.paintComponent(g);
          Graphics2D g2 = (Graphics2D)g; 
          g2.drawLine(-100,0,500,0);
          g2.drawLine(141,-500,141,500);
          g2.translate(getWidth()/2.0, getHeight()/2.0);
          g2.scale(1,-1);
          g2.rotate(45*Math.PI/180);
          Rectangle2D r = new Rectangle2D.Double(0,0,100,100);
          g2.fill(r);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xcHuB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xcHuB.jpg" alt="Output"></a></p>