title: Adding a video player to a JPanel in java using VLCJ
body: <p>I am currently in the position of having 2 pieces of work I wish to combine. I have a simple media player running in a JFrame and a GUI I would like to add video playback to on a JPanel.</p>
  
  <p>The code for the which creates video player window is as follows:</p>
  
  <pre><code>private final JFrame vidFrame;
  private final EmbeddedMediaPlayerComponent vidComp;
  
  //Creates JPanel for video player
  public Video() {
  
      vidFrame = new JFrame("VLC video test");
      vidFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      vidFrame.setLocation(100, 100);
      vidFrame.setSize(800, 800);
  
      vidComp = new EmbeddedMediaPlayerComponent();
  
      //This is the point where I am trying to add the video player to the GUI
      MainWindow.vidPanel.add(vidComp);
  
      vidFrame.add(vidComp);
      vidFrame.setVisible(true);
  }
  </code></pre>
  
  <p>And this is the panel I'm trying to add the player to:</p>
  
  <pre><code>    JPanel vidPanel = new JPanel();
      vidPanel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
      vidPanel.setBounds(10, 11, 532, 400);
      contentPane.add(vidPanel);
  </code></pre>
  
  <p>I get the error message: "vidPanel cannot be resolved or is not a field"</p>
  
  <p>Does anyone know how I can rectify this?</p>