# Mehrere Scrollbar objekte miteinander verbinden



## lordsaibo (21. Feb 2007)

hallo 
habe folgendes Problem ich habe in meinem Programm 6 Scrollbar Elemente eingebaut von denen 3 das RGB Farbsystem und 3 das HSB Farbsystem betreffen. Wie kann ich es hinbekommen dass ich z.b. erst an der Rot Scrollbar etwas verändere und dann mit dem Helligkeitsregler im HSB System etwas anpasse? Bisher lassem sich die HSB Regler noch gar nicht verwenden. irgendwie muss man diese Scrollbar elemente glaube ich miteinander bekannt machen damit sie zusammenarbeiten können?

Ich poste einfach mal mein komplettes Programm:


```
import java.awt.*;
import java.awt.event.*;
public class Regler extends Frame implements AdjustmentListener
{
    private Scrollbar s1 = new Scrollbar(Scrollbar.HORIZONTAL);
    private Scrollbar s2 = new Scrollbar(Scrollbar.HORIZONTAL);
    private Scrollbar s3 = new Scrollbar(Scrollbar.HORIZONTAL);
    private Scrollbar s4 = new Scrollbar(Scrollbar.HORIZONTAL);
    private Scrollbar s5 = new Scrollbar(Scrollbar.HORIZONTAL);
    private Scrollbar s6 = new Scrollbar(Scrollbar.HORIZONTAL);
    //Startfarbe:
    private Color farbe = new Color(255, 255, 255, 100);
    //Zufallsfarbe:
    int random1 = (int) (Math.random()*255);
    int random2 = (int) (Math.random()*255);
    int random3 = (int) (Math.random()*255);
    private Color farbe_random = new Color (random1,random2,random3,100);
    
    private Panel farbfeld = new Panel();
    private Panel farbfeld2 = new Panel();
    private Label l11;
    private Label l22;
    private Label l33;
    private Label l44;
    private Label l55;
    private Label l66;
    
    public int rot;
    public int gruen;
    public int blau;
    
    public int farbe_hsb;
    public int saettigung;
    public int helligkeit;

    
    public Regler(){
        setLayout(null);
        setBounds(0,0,1000,600);
        setBackground(Color.BLACK);
        setTitle("Farben aendern");
        
        addWindowListener(new WindowAdapter()
        {
            public void windowClosing(final WindowEvent e) {
                System.exit(0);
            }
        });
        
        farbfeld.setBounds(500,50,200,500);
        farbfeld.setBackground(farbe);
        add(farbfeld);
        
        
        farbfeld2.setBounds(750,50,200,500);
        farbfeld2.setBackground(farbe_random);
        add(farbfeld2);
        
        // ---------------------------
        
        // Regler1: Rot RGB
        s1.setBounds(100,50,250,20);              //(Start x, Start y, Länge x, Länge y)
        s1.addAdjustmentListener(this);
        s1.setName("rot");
        s1.setMinimum(0);
        s1.setMaximum(265);
        add(s1);
        
        Label l1 = new Label("RGB Rot ");
        l1.setBounds(20,50,70, 20);
        l1.setBackground(Color.WHITE);
        add(l1);
        
        l11 = new Label();
        l11.setBounds(360, 50, 80, 20);
        l11.setBackground(Color.WHITE);
        add(l11);
        
        // Regler2: Gruen RGB
        s2.setBounds(100,100,250,20);
        s2.addAdjustmentListener(this);
        s2.setName("gruen");
        s2.setMinimum(0);
        s2.setMaximum(265);
        add(s2);
        
        Label l2 = new Label("RGB Gruen ");
        l2.setBounds(20,100, 70, 20);
        l2.setBackground(Color.WHITE);
        add(l2);
        
        l22 = new Label();
        l22.setBounds(360, 100, 80, 20);
        l22.setBackground(Color.WHITE);
        add(l22);
        
        // Regler3: Blau RGB
        s3.setBounds(100,150,250,20);
        s3.addAdjustmentListener(this);
        s3.setName("blau");
        s3.setMinimum(0);
        s3.setMaximum(265);
        add(s3);
        
        Label l3 = new Label("RGB Blau ");
        l3.setBounds(20,150, 70, 20);
        l3.setBackground(Color.WHITE);
        add(l3);
        
        l33 = new Label();
        l33.setBounds(360, 150, 80, 20);
        l33.setBackground(Color.WHITE);
        add(l33);
        
        
        
        // ---------------------------
        
         // Regler4:
        s4.setBounds(100,250,250,20);              //(Start x, Start y, Länge x, Länge y)
        s4.addAdjustmentListener(this);
        s4.setName("rot");
        s4.setMinimum(0);
        s4.setMaximum(265);
        add(s4);

        Label l4 = new Label("HSB Farbe ");
        l4.setBounds(20,250,70, 20);
        l4.setBackground(Color.WHITE);
        add(l4);

        l44 = new Label();
        l44.setBounds(360,250, 80, 20);
        l44.setBackground(Color.WHITE);
        add(l44);

         // Regler5:
        s5.setBounds(100,300,250,20);              //(Start x, Start y, Länge x, Länge y)
        s5.addAdjustmentListener(this);
        s5.setName("rot");
        s5.setMinimum(0);
        s5.setMaximum(265);
        add(s5);

        Label l5 = new Label("Sättigung ");
        l5.setBounds(20,300,70, 20);
        l5.setBackground(Color.WHITE);
        add(l5);

        l55 = new Label();
        l55.setBounds(360,300, 80, 20);
        l55.setBackground(Color.WHITE);
        add(l55);
        
          // Regler6:
        s6.setBounds(100,350,250,20);              //(Start x, Start y, Länge x, Länge y)
        s6.addAdjustmentListener(this);
        s6.setName("rot");
        s6.setMinimum(0);
        s6.setMaximum(265);
        add(s6);

        Label l6 = new Label("Helligkeit ");
        l6.setBounds(20,350,70, 20);
        l6.setBackground(Color.WHITE);
        add(l6);

        l66 = new Label();
        l66.setBounds(360,350, 80, 20);
        l66.setBackground(Color.WHITE);
        add(l66);
        
        
        // Zweites Farbfeld
        
        

    }
    
    public void adjustmentValueChanged(final AdjustmentEvent e)
    {

        
        float[] hsbvals = Color.RGBtoHSB(rot, gruen, blau, null);        //umrechnen in hsb
        farbe_hsb = ((int)(hsbvals[0]*360));          // Grad
        saettigung = ((int)(hsbvals[0]*360));         // Sättigung
        helligkeit = ((int)(hsbvals[2]*100));         // Helligkeit

        l11.setText(""+rot);               // Textfelder rgb
        l22.setText(""+gruen);
        l33.setText(""+blau);
        
        l44.setText(""+ farbe_hsb);          // Textfelder hsb
        l55.setText(""+ saettigung);
        l66.setText(""+ helligkeit);
        
        s4.setValue(farbe_hsb);            // Hsb Regler werden angepasst.
        s5.setValue(saettigung);
        s6.setValue(helligkeit);
        
        
        
        
        rot = s1.getValue();             // Farbfeld wird umgefärbt
        gruen = s2.getValue();
        blau = s3.getValue();

        farbfeld.setBackground(new Color(rot, gruen, blau));
    }
    
    
    

    
    



     
    public static void main(String [] args)
    {
         new Regler().setVisible(true);

    }
}
```


----------



## André Uhres (24. Feb 2007)

```
package basics;
/*
 * Regler.java
 */
import java.awt.*;
import java.awt.event.*;
import java.math.BigDecimal;
public class Regler extends Frame implements AdjustmentListener {
    final private Scrollbar s1 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s2 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s3 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s4 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s5 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s6 = new Scrollbar(Scrollbar.HORIZONTAL);
    //Startfarbe:
    final private Color farbe = new Color(255, 255, 255, 100);
    //Zufallsfarbe:
    final int random1 = (int) (Math.random()*255);
    final int random2 = (int) (Math.random()*255);
    final int random3 = (int) (Math.random()*255);
    final private Color farbe_random = new Color(random1,random2,random3,100);
    final private Panel farbfeld = new Panel();
    final private Panel farbfeld2 = new Panel();
    final private Label l11;
    final private Label l22;
    final private Label l33;
    final private Label l44;
    final private Label l55;
    final private Label l66;
    final private BigDecimal BD360 = new BigDecimal("360");
    final private BigDecimal BD100 = new BigDecimal("100");
    public int rot;
    public int gruen;
    public int blau;
    public int farbe_hsb;
    public int saettigung;
    public int helligkeit;
    public Regler(){
        setLayout(null);
        setBounds(0,0,1000,600);
        setBackground(Color.BLACK);
        setTitle("Farben aendern");
        addWindowListener(new WindowAdapter() {
            public void windowClosing(final WindowEvent e) {
                System.exit(0);
            }
        });
        farbfeld.setBounds(500,50,200,500);
        farbfeld.setBackground(farbe);
        add(farbfeld);
        farbfeld2.setBounds(750,50,200,500);
        farbfeld2.setBackground(farbe_random);
        add(farbfeld2);
        // ---------------------------
        // Regler1: Rot RGB
        s1.setBounds(100,50,250,20);              //(Start x, Start y, Länge x, Länge y)
        s1.addAdjustmentListener(this);
        s1.setName("rot");
        s1.setMinimum(0);
        s1.setMaximum(265);
        add(s1);
        Label l1 = new Label("RGB Rot ");
        l1.setBounds(20,50,70, 20);
        l1.setBackground(Color.WHITE);
        add(l1);
        l11 = new Label();
        l11.setBounds(360, 50, 80, 20);
        l11.setBackground(Color.WHITE);
        add(l11);
        // Regler2: Gruen RGB
        s2.setBounds(100,100,250,20);
        s2.addAdjustmentListener(this);
        s2.setName("gruen");
        s2.setMinimum(0);
        s2.setMaximum(265);
        add(s2);
        Label l2 = new Label("RGB Gruen ");
        l2.setBounds(20,100, 70, 20);
        l2.setBackground(Color.WHITE);
        add(l2);
        l22 = new Label();
        l22.setBounds(360, 100, 80, 20);
        l22.setBackground(Color.WHITE);
        add(l22);
        // Regler3: Blau RGB
        s3.setBounds(100,150,250,20);
        s3.addAdjustmentListener(this);
        s3.setName("blau");
        s3.setMinimum(0);
        s3.setMaximum(265);
        add(s3);
        Label l3 = new Label("RGB Blau ");
        l3.setBounds(20,150, 70, 20);
        l3.setBackground(Color.WHITE);
        add(l3);
        l33 = new Label();
        l33.setBounds(360, 150, 80, 20);
        l33.setBackground(Color.WHITE);
        add(l33);
        // ---------------------------
        // Regler4:
        s4.setBounds(100,250,250,20);              //(Start x, Start y, Länge x, Länge y)
        s4.addAdjustmentListener(this);
        s4.setName("rot");
        s4.setMinimum(0);
        s4.setMaximum(370);
        add(s4);
        Label l4 = new Label("HSB Farbe ");
        l4.setBounds(20,250,70, 20);
        l4.setBackground(Color.WHITE);
        add(l4);
        l44 = new Label();
        l44.setBounds(360,250, 80, 20);
        l44.setBackground(Color.WHITE);
        add(l44);
        // Regler5:
        s5.setBounds(100,300,250,20);              //(Start x, Start y, Länge x, Länge y)
        s5.addAdjustmentListener(this);
        s5.setName("rot");
        s5.setMinimum(0);
        s5.setMaximum(110);
        add(s5);
        Label l5 = new Label("Sättigung ");
        l5.setBounds(20,300,70, 20);
        l5.setBackground(Color.WHITE);
        add(l5);
        l55 = new Label();
        l55.setBounds(360,300, 80, 20);
        l55.setBackground(Color.WHITE);
        add(l55);
        // Regler6:
        s6.setBounds(100,350,250,20);              //(Start x, Start y, Länge x, Länge y)
        s6.addAdjustmentListener(this);
        s6.setName("rot");
        s6.setMinimum(0);
        s6.setMaximum(110);
        add(s6);
        Label l6 = new Label("Helligkeit ");
        l6.setBounds(20,350,70, 20);
        l6.setBackground(Color.WHITE);
        add(l6);
        l66 = new Label();
        l66.setBounds(360,350, 80, 20);
        l66.setBackground(Color.WHITE);
        add(l66);
        // Zweites Farbfeld
    }
    public void adjustmentValueChanged(final AdjustmentEvent e) {
        Object s = e.getSource();
        if(s==s1 || s==s2 || s==s3){
            rot = s1.getValue();             // Farbfeld wird umgefärbt
            gruen = s2.getValue();
            blau = s3.getValue();
            farbfeld.setBackground(new Color(rot, gruen, blau));
            float[] hsbvals = Color.RGBtoHSB(rot, gruen, blau, null);        //umrechnen in hsb
            farbe_hsb = new BigDecimal(hsbvals[0]).multiply(BD360)
            .setScale(0, BigDecimal.ROUND_HALF_UP).intValue();// Grad
            saettigung = new BigDecimal(hsbvals[1]).multiply(BD100)
            .setScale(0, BigDecimal.ROUND_HALF_UP).intValue();// Sättigung
            helligkeit = new BigDecimal(hsbvals[2]).multiply(BD100)
            .setScale(0, BigDecimal.ROUND_HALF_UP).intValue();// Helligkeit
            l11.setText(""+rot);               // Textfelder rgb
            l22.setText(""+gruen);
            l33.setText(""+blau);
            l44.setText(""+ farbe_hsb);          // Textfelder hsb
            l55.setText(""+ saettigung);
            l66.setText(""+ helligkeit);
            s4.setValue(farbe_hsb);            // Hsb Regler werden angepasst.
            s5.setValue(saettigung);
            s6.setValue(helligkeit);
        }else{
            farbe_hsb = s4.getValue();             // Farbfeld wird umgefärbt
            saettigung = s5.getValue();
            helligkeit = s6.getValue();
            int rgb = Color.HSBtoRGB(farbe_hsb/360f, saettigung/100f, helligkeit/100f);        //umrechnen in rgb
            rot = (rgb>>16)&0xFF;
            gruen = (rgb>>8)&0xFF;
            blau = rgb&0xFF;
            farbfeld.setBackground(new Color(rot, gruen, blau));
            l11.setText(""+rot);               // Textfelder rgb
            l22.setText(""+gruen);
            l33.setText(""+blau);
            l44.setText(""+ farbe_hsb);          // Textfelder hsb
            l55.setText(""+ saettigung);
            l66.setText(""+ helligkeit);
            s1.setValue(rot);            // rgb Regler werden angepasst.
            s2.setValue(gruen);
            s3.setValue(blau);
        }
    }
    public static void main(final String [] args) {new Regler().setVisible(true);}
}
```


----------



## Mythos (2. Nov 2007)

Hi,

ich sitze an einer änlichen Aufgabe, allerdings mit dem Zusatz, das auch die manuelle Eingabe eines Wertes in die Textfelder die Hintergrundfarbe ändert und die Position des entsprechenden Sliders.

Wie könnte man das am obigen Beispiel von André realisieren ?

Gruß

Mythos


----------



## André Uhres (2. Nov 2007)

Mythos hat gesagt.:
			
		

> ..das auch die manuelle Eingabe eines Wertes in die Textfelder die Hintergrundfarbe ändert
> und die Position des entsprechenden Sliders..




```
package basics;
/*
* Regler2.java
*/
import java.awt.*;
import java.awt.event.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.math.BigDecimal;
public class Regler2 extends Frame implements AdjustmentListener, ActionListener, PropertyChangeListener {
    final private Scrollbar s1 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s2 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s3 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s4 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s5 = new Scrollbar(Scrollbar.HORIZONTAL);
    final private Scrollbar s6 = new Scrollbar(Scrollbar.HORIZONTAL);
    //Startfarbe:
    final private Color farbe = new Color(255, 255, 255, 100);
    //Zufallsfarbe:
    final int random1 = (int) (Math.random()*255);
    final int random2 = (int) (Math.random()*255);
    final int random3 = (int) (Math.random()*255);
    final private Color farbe_random = new Color(random1,random2,random3,100);
    final private Panel farbfeld = new Panel();
    final private Panel farbfeld2 = new Panel();
    final private TextField l11;
    final private TextField l22;
    final private TextField l33;
    final private TextField l44;
    final private TextField l55;
    final private TextField l66;
    final private BigDecimal BD360 = new BigDecimal("360");
    final private BigDecimal BD100 = new BigDecimal("100");
    public int rot;
    public int gruen;
    public int blau;
    public int farbe_hsb;
    public int saettigung;
    public int helligkeit;
    public Regler2(){
        setLayout(null);
        setBounds(0,0,1000,600);
        setBackground(Color.BLACK);
        setTitle("Farben aendern");
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(final WindowEvent e) {
                System.exit(0);
            }
        });
        farbfeld.setBounds(500,50,200,500);
        farbfeld.setBackground(farbe);
        add(farbfeld);
        farbfeld2.setBounds(750,50,200,500);
        farbfeld2.setBackground(farbe_random);
        add(farbfeld2);
        // ---------------------------
        // Regler1: Rot RGB
        s1.setBounds(100,50,250,20);              //(Start x, Start y, Länge x, Länge y)
        s1.addAdjustmentListener(this);
        s1.setName("rot");
        s1.setMinimum(0);
        s1.setMaximum(265);
        add(s1);
        Label l1 = new Label("RGB Rot ");
        l1.setBounds(20,50,70, 20);
        l1.setBackground(Color.WHITE);
        add(l1);
        l11 = new TextField();
        l11.setBounds(360, 50, 80, 20);
        l11.setBackground(Color.WHITE);
        add(l11);
        // Regler2: Gruen RGB
        s2.setBounds(100,100,250,20);
        s2.addAdjustmentListener(this);
        s2.setName("gruen");
        s2.setMinimum(0);
        s2.setMaximum(265);
        add(s2);
        Label l2 = new Label("RGB Gruen ");
        l2.setBounds(20,100, 70, 20);
        l2.setBackground(Color.WHITE);
        add(l2);
        l22 = new TextField();
        l22.setBounds(360, 100, 80, 20);
        l22.setBackground(Color.WHITE);
        add(l22);
        // Regler3: Blau RGB
        s3.setBounds(100,150,250,20);
        s3.addAdjustmentListener(this);
        s3.setName("blau");
        s3.setMinimum(0);
        s3.setMaximum(265);
        add(s3);
        Label l3 = new Label("RGB Blau ");
        l3.setBounds(20,150, 70, 20);
        l3.setBackground(Color.WHITE);
        add(l3);
        l33 = new TextField();
        l33.setBounds(360, 150, 80, 20);
        l33.setBackground(Color.WHITE);
        add(l33);
        // ---------------------------
        // Regler4:
        s4.setBounds(100,250,250,20);              //(Start x, Start y, Länge x, Länge y)
        s4.addAdjustmentListener(this);
        s4.setName("rot");
        s4.setMinimum(0);
        s4.setMaximum(370);
        add(s4);
        Label l4 = new Label("HSB Farbe ");
        l4.setBounds(20,250,70, 20);
        l4.setBackground(Color.WHITE);
        add(l4);
        l44 = new TextField();
        l44.setBounds(360,250, 80, 20);
        l44.setBackground(Color.WHITE);
        add(l44);
        // Regler5:
        s5.setBounds(100,300,250,20);              //(Start x, Start y, Länge x, Länge y)
        s5.addAdjustmentListener(this);
        s5.setName("rot");
        s5.setMinimum(0);
        s5.setMaximum(110);
        add(s5);
        Label l5 = new Label("Sättigung ");
        l5.setBounds(20,300,70, 20);
        l5.setBackground(Color.WHITE);
        add(l5);
        l55 = new TextField();
        l55.setBounds(360,300, 80, 20);
        l55.setBackground(Color.WHITE);
        add(l55);
        // Regler6:
        s6.setBounds(100,350,250,20);              //(Start x, Start y, Länge x, Länge y)
        s6.addAdjustmentListener(this);
        s6.setName("rot");
        s6.setMinimum(0);
        s6.setMaximum(110);
        add(s6);
        Label l6 = new Label("Helligkeit ");
        l6.setBounds(20,350,70, 20);
        l6.setBackground(Color.WHITE);
        add(l6);
        l66 = new TextField();
        l66.setBounds(360,350, 80, 20);
        l66.setBackground(Color.WHITE);
        add(l66);
        
        l11.addActionListener(this);
        l22.addActionListener(this);
        l33.addActionListener(this);
        l44.addActionListener(this);
        l55.addActionListener(this);
        l66.addActionListener(this);
        s1.addPropertyChangeListener("gui", this);
        s2.addPropertyChangeListener("gui", this);
        s3.addPropertyChangeListener("gui", this);
        s4.addPropertyChangeListener("gui", this);
        s5.addPropertyChangeListener("gui", this);
        s6.addPropertyChangeListener("gui", this);
    }

    @Override
    public void adjustmentValueChanged(final AdjustmentEvent e) {
        updateGUI(e.getSource());
    }

    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        if(evt.getPropertyName().equals("gui")){
            updateGUI(evt.getSource());
        }
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Object source = e.getSource();
        if(source == l11) postChange(s1, (TextField)source);
        if(source == l22) postChange(s2, (TextField)source);
        if(source == l33) postChange(s3, (TextField)source);
        if(source == l44) postChange(s4, (TextField)source);
        if(source == l55) postChange(s5, (TextField)source);
        if(source == l66) postChange(s6, (TextField)source);
    }

    private void postChange(Scrollbar scrollbar, TextField textfield) {
            int oldValue = scrollbar.getValue();
            int value = Integer.parseInt(textfield.getText());
            scrollbar.setValue(value);
            scrollbar.firePropertyChange("gui", oldValue, value);
    }

    private void updateGUI(Object s) {
        if(s==s1 || s==s2 || s==s3){
            rot = s1.getValue();             // Farbfeld wird umgefärbt
            gruen = s2.getValue();
            blau = s3.getValue();
            farbfeld.setBackground(new Color(rot, gruen, blau));
            float[] hsbvals = Color.RGBtoHSB(rot, gruen, blau, null);        //umrechnen in hsb
            farbe_hsb = new BigDecimal(hsbvals[0]).multiply(BD360)
            .setScale(0, BigDecimal.ROUND_HALF_UP).intValue();// Grad
            saettigung = new BigDecimal(hsbvals[1]).multiply(BD100)
            .setScale(0, BigDecimal.ROUND_HALF_UP).intValue();// Sättigung
            helligkeit = new BigDecimal(hsbvals[2]).multiply(BD100)
            .setScale(0, BigDecimal.ROUND_HALF_UP).intValue();// Helligkeit
            l11.setText(""+rot);               // Textfelder rgb
            l22.setText(""+gruen);
            l33.setText(""+blau);
            l44.setText(""+ farbe_hsb);          // Textfelder hsb
            l55.setText(""+ saettigung);
            l66.setText(""+ helligkeit);
            s4.setValue(farbe_hsb);            // Hsb Regler werden angepasst.
            s5.setValue(saettigung);
            s6.setValue(helligkeit);
        }else{
            farbe_hsb = s4.getValue();             // Farbfeld wird umgefärbt
            saettigung = s5.getValue();
            helligkeit = s6.getValue();
            int rgb = Color.HSBtoRGB(farbe_hsb/360f, saettigung/100f, helligkeit/100f);        //umrechnen in rgb
            rot = (rgb>>16)&0xFF;
            gruen = (rgb>>8)&0xFF;
            blau = rgb&0xFF;
            farbfeld.setBackground(new Color(rot, gruen, blau));
            l11.setText(""+rot);               // Textfelder rgb
            l22.setText(""+gruen);
            l33.setText(""+blau);
            l44.setText(""+ farbe_hsb);          // Textfelder hsb
            l55.setText(""+ saettigung);
            l66.setText(""+ helligkeit);
            s1.setValue(rot);            // rgb Regler werden angepasst.
            s2.setValue(gruen);
            s3.setValue(blau);
        }

    }
    public static void main(final String [] args) {new Regler2().setVisible(true);}    
}
```
Wenn der Wert eines Textfeldes manuell verändert wird, 
dann muss er mit der Eingabetaste bestätigt werden.


----------

