Wie erstellt man diverse Auswahlboxen die Zusammenhängen?

Status
Nicht offen für weitere Antworten.
G

Guest

Gast
Hallo Leute

Ich suche die Möglichkeit mehrere wie im Bild abgebildete Auswahlboxen zu erstellen, die mit einander verbunden sind und letztendlich einen Link ausführen.
Hat jemand eine Idee wie man das macht. Für eine nicht allzu komplizierte Lösung wäre ich Euch dankbar.


layout%20wz.jpg


Für Eure Hilfe besten Dank
rave1
 
S

SlaterB

Gast
was gibts da groß zu verbinden?
die sind alle 4 Exemplarvariablen,
wenn eine gesetzt wird, dann ändert sie evtl. den Inhalt der anderen,

erst mal so bauen, wenns Probleme gibt, dann weiter nachdenken
 

Marco13

Top Contributor
Ein bißchen pseudodocde mit Stichworten:

Code:
JComboBox kontinentComboBox;
JComboBox landComboBox;
...

meinPanel.setLayout(new GridLayout(1, anzahlDerBoxes));
initKontinentComboBox();
meinPanel.add(kontinentComboBox);
...

void initKontinentComboBox()
{
    kontinentComboBox = new JComboBox(...);
    kontinentComboBox.addActionListener(new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
            String kontinentName = e.getActionCommand();
            landComboBox = initLandComboBox(kontinentName);
            meinPanel.add(landComboBox);
        }
    }
}

void initLandComboBox(String kontinentName)
{
    landComboBox = new JComboBox(...);
    landComboBox.addActionListener(new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
            String landName = e.getActionCommand();
            landComboBox = initStadtComboBox(landName);
            meinPanel.add(stadtComboBox);
        }
    }
}

...

Gibt aber noch 1000 andere Möglichkeiten.
 

rave1

Neues Mitglied
Ihr habt recht ich müsste es wohl in javascript haben.

Ist das Möglich bin Anfänger.

Besten Dank
rave1
 
Status
Nicht offen für weitere Antworten.

Oben