title: Rendering a single point in a JFreeChart based on the current Value of a Slider
body: <p>I'm not yet as much into Java as I'd like to be, so I find my current task to be quite a bit challenging:</p>
  
  <ul>
  <li>A chart showing data gathered in another class.</li>
  <li>A slider whose end value is determined by the last entry of in the dataset used in the chart.</li>
  <li>The playbutton currently doesn't do anything except letting the slider tick in steps of 5 until it is paused again.</li>
  </ul>
  
  <p>My problem right now is: I am supposed to highlight one item at a time in the chart based on which value the slider currently shows.</p>
  
  <p>And to be honest... I'm not yet used to renderers yet.</p>
  
  <p>If I understood it correctly I would need to use</p>
  
  <pre><code> renderer.drawItem(java.awt.Graphics2D g2,
            XYItemRendererState state,
            java.awt.geom.Rectangle2D dataArea,
            PlotRenderingInfo info,
            XYPlot plot,
            ValueAxis domainAxis,
            ValueAxis rangeAxis,
            XYDataset dataset,
            int series,
            int item,
            CrosshairState crosshairState,
            int pass)
  </code></pre>
  
  <p>but I am totally inexperienced with as well the method as its arguments and got no idea how to initialize them.</p>
  
  <p>I mean... I got a plot, a dataset, and 2 series from the chart, I also suggest "item" would be the index of the item to highlight in the series, which I could convert from the slider-value.</p>
  
  <p>Unfortunately plaguing google about it turned out to be rather frustrating since all I got was the very code I posted above on about 50 different pages (I gave up after).</p>
  
  <p>I would like to know ... first of all if I am even about to use the correct method and, as ashamed as I am to ask like this... how to use it.</p>
  
  <p>Well... looking forward to some answers and... thanks in advance.</p>