content: /*
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  package sliderapp;
  
  /**
   *
   * @author badhr
   */
  public class SliderWindow extends javax.swing.JFrame implements SliderObserver{
  
      private SliderControl sliderControl;
      /**
       * Creates new form SliderWindow
       */
      public SliderWindow(SliderControl sliderControl) {
          initComponents();
          this.sliderControl = sliderControl;
          setVisible(true);
      }
  
      /**
       * This method is called from within the constructor to initialize the form.
       * WARNING: Do NOT modify this code. The content of this method is always
       * regenerated by the Form Editor.
       */
      @SuppressWarnings("unchecked")
      // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
      private void initComponents() {
  
          jSlider = new javax.swing.JSlider();
  
          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  
          jSlider.setOrientation(javax.swing.JSlider.VERTICAL);
          jSlider.addChangeListener(new javax.swing.event.ChangeListener() {
              public void stateChanged(javax.swing.event.ChangeEvent evt) {
                  jSliderStateChanged(evt);
              }
          });
  
          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
          getContentPane().setLayout(layout);
          layout.setHorizontalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(221, 221, 221)
                  .addComponent(jSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(246, Short.MAX_VALUE))
          );
          layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(100, 100, 100)
                  .addComponent(jSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(130, Short.MAX_VALUE))
          );
  
          pack();
      }// </editor-fold>//GEN-END:initComponents
  
      private void jSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderStateChanged
          this.sliderControl.Notify(this.jSlider.getValue());
      }//GEN-LAST:event_jSliderStateChanged
  
      /**
       * @param args the command line arguments
       */
      
  
      @Override
      public void update(int value) {
          this.jSlider.setValue(value);
      }
  
      // Variables declaration - do not modify//GEN-BEGIN:variables
      private javax.swing.JSlider jSlider;
      // End of variables declaration//GEN-END:variables
  }
  