title: Jpanel inside Jframe with paint
body: <p>hi i'm triyng to do something like this <a href="http://i.stack.imgur.com/qhyj3.png" rel="nofollow">example</a></p>
  
  <p>but i'm always getting the cross or in top-west or it doesn't appear and don't know why. I try to see the borderLayout and some stackoverflow explanations examples but didn´t find anything related. can someone explain to me what i'm doing wrong and why please?</p>
  
  <pre><code>public Base() {
          super("Menu");
          JPanel p = createPanel();
          Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
  
          setSize(screen.width, screen.height);
          setVisible(true);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setLayout(new BorderLayout());
          add(p);
      }
  
      private JPanel createPanel() {
          JPanel P = new JPanel() {
              public void paint(Graphics g) {
                  super.paint(g);
                  Graphic gr = new Graphicimpl();
                  g.drawLine(gr.PositionX(-25.0), gr.PositionY(0.0), gr.PositionX(25.0), gr.PositionY(0.0));
                  g.drawLine(gr.PositionX(0.0), gr.PositionY(25.0), gr.PositionX(0.0), gr.PositionY(-25.0));
  
              }
          };
  
          //P.setSize(50, 50);
          //P.setBorder(BorderFactory.createEmptyBorder(300, 300, 300, 300));
          return P;
      }
  }
  public class Graphicimpl implements Graphic{
      int FACTOr_ESCALACION = 10;
  
  
      public  int PositionX(Double x) {
          return (int) ((x *  FACTOr_ESCALACION) + 320);
      }
  
      @Override
      public int PositionY(Double y) {
          return (int) ( - (y * FACTOr_ESCALACION ) +240);
      }
  
  
  }
  
  public interface Graphic {
      int PositionX(Double x);
      int PositionY(Double y);
  }
  public class Main {
      public static void main(String args[]) {
          Base base=new Base();
      }
  
  }
  </code></pre>