title: Change Hue of Picture in Graphics
body: <p>Ok so i need help changing the hue of this slider. I cant seem to figure it out. Please no @override. I need something that will run on Ready to Program. The hue will change back to normal when the slider is back at 0. I dont need to get too complex. Just a simple Hue slider will be great. Thanks!</p>
  
  <pre><code>import java.awt.*;
  import java.awt.event.*;
  import javax.swing.*;
  import java.applet.Applet;
  import javax.swing.event.*;
  import java.applet.*;
  
  public class test extends Applet implements ActionListener, ChangeListener
  {
  
      //Widgets, Panels
      JSlider slider;
      Panel flow;
      int colorr;
      int colorg;
      int colorb;
      int stars;
      //House Coordinates, initialized to 1. (Top Right and No Scaling)
  
  
      public void init ()
      { //Set Up Input Fields for House Coordinates
          resize (380, 240);
          setBackground (new Color (102, 179, 255));
  
          slider = new JSlider ();
          slider.setValue (0);
          slider.setBackground (new Color (102, 179, 255));
          slider.setForeground (Color.white);
          slider.setMajorTickSpacing (20);
          slider.setMinorTickSpacing (5);
          slider.setPaintTicks (true);
          slider.addChangeListener (this);
  
  
          //Set up layout, add widgets
          setLayout (new BorderLayout ());
          flow = new Panel (new FlowLayout ());
          flow.add (slider);
          add (flow, "South");
  
      }
  
  
      public void paint (Graphics g)
      {
          Graphics2D g2d = (Graphics2D) g;
          Color color1 = getBackground ();
          Color color2 = color1.darker ();
          int x = getWidth ();
          int y = getHeight () - 30;
          GradientPaint gp = new GradientPaint (
                  0, 0, color1,
                  0, y, color2);
  
          g2d.setPaint (gp);
          g2d.fillRect (0, 0, x, y);
  
          stars (10, 10);
      }
  
  
      public void stars (int x, int y)
      {
          Graphics g = getGraphics ();
  
          //sun
          g.setColor (new Color (139, 166, 211));
          g.fillOval (-200, 170, 1000, 400);
  
          g.setColor (new Color (206, 75, 239));
          g.fillOval (x, y, 10, 10);                      //First medium star
          g.drawLine (x + 5, y, x + 5, 0);
          g.drawLine (x, y + 5, 0, y + 5);
          g.drawLine (x + 5, y + 10, x + 5, y + 20);
          g.drawLine (x + 10, y + 5, x + 20, y + 5);
  
          g.fillOval (x + 80, y + 30, 12, 12);            //Middle medium star
          g.drawLine (x + 86, y + 30, x + 86, y + 18);
          g.drawLine (x + 80, y + 36, x + 68, y + 36);
          g.drawLine (x + 92, y + 36, x + 104, y + 36);
          g.drawLine (x + 86, y + 42, x + 86, y + 52);
  
          colorr = (int) (Math.random () * 255) + 1;
          colorg = (int) (Math.random () * 255) + 1;
          colorb = (int) (Math.random () * 255) + 1;
          int randomx = (int) (Math.random () * 300) + 10;
          int randomy = (int) (Math.random () * 150) + 10;
  
          stars = 50; //Change for more stars
  
          int ax[] = new int [stars];
          int ay[] = new int [stars];
  
          for (int i = 0 ; i &lt; stars ; i++)
          {
              g.setColor (new Color (colorr, colorg, colorb));
              colorr = (int) (Math.random () * 255) + 1;
              colorg = (int) (Math.random () * 255) + 1;
              colorb = (int) (Math.random () * 255) + 1;
  
              while ((randomx &gt; 88 &amp;&amp; randomx &lt; 116) &amp;&amp; (randomy &lt; 65 &amp;&amp; randomy &gt; 15))
              {
                  randomx = (int) (Math.random () * 300) + 10;
                  randomy = (int) (Math.random () * 150) + 10;
              }
  
              while ((randomx &gt; 0 &amp;&amp; randomx &lt; 25) &amp;&amp; (randomy &gt; 5 &amp;&amp; randomy &lt; 35))
              {
                  randomx = (int) (Math.random () * 300) + 10;
                  randomy = (int) (Math.random () * 150) + 10;
              }
              g.drawOval (randomx, randomy, 5, 5);
              randomx = (int) (Math.random () * 300) + 10;
              randomy = (int) (Math.random () * 150) + 10;
          }
  
          g.setColor (Color.white);
          g.drawLine (320, 0, 315, 40);
          g.drawLine (320, 0, 325, 40);
          g.drawLine (320, 120, 315, 80);
          g.drawLine (320, 120, 325, 80);
          g.drawLine (260, 60, 300, 55);
          g.drawLine (260, 60, 300, 65);
          g.drawLine (380, 60, 340, 55);
          g.drawLine (380, 60, 340, 65);
          fillGradOval (280, 20, 80, 80, new Color (254, 238, 44), new Color (255, 251, 191), g);
  
          g.setColor (new Color (255, 251, 191));
          fillGradOval (300, 40, 40, 40, new Color (255, 251, 191), new Color (254, 238, 44), g);
      }
  
  
      public void fillGradOval (int X, int Y, int H2, int W2, Color c1, Color c2, Graphics g)
      {
          g.setColor (c1);
          g.fillOval (X, Y, W2, H2);
          Color Gradient = c1;
          float red = (c2.getRed () - c1.getRed ()) / (W2 / 2);
          float blue = (c2.getBlue () - c1.getBlue ()) / (W2 / 2);
          float green = (c2.getGreen () - c1.getGreen ()) / (W2 / 2);
  
          int scale = 1;
          int r = c1.getRed ();
          int gr = c1.getGreen ();
          int b = c1.getBlue ();
  
          while (W2 &gt; 10)
          {
              r = (int) (r + red);
              gr = (int) (gr + green);
              b = (int) (b + blue);
  
              Gradient = new Color (r, gr, b);
              g.setColor (Gradient);
  
              W2 = W2 - 2 * scale;
              H2 = H2 - 2 * scale;
              X = X + scale;
              Y = Y + scale;
  
              g.fillOval (X, Y, W2, H2);
          }
      }
  
  
      public void actionPerformed (ActionEvent e)
      {
  
      }
  
  
      public void stateChanged (ChangeEvent e)
      {
          JSlider source = (JSlider) e.getSource ();
          if (!source.getValueIsAdjusting ())
          {
  
          }
      }
  }
  </code></pre>