Ok il try to explain it better

The logic behind it is the user chooses his choice from each comboBox.
EnsembleSize, baseModel, Randomize and dataChoices

Each is populated with an array.
EnsembleSizeItems, baseModelItems, RandomizeItems and dataItems

I've constructed other arrays that contain actual arguments that I will later develop code to pass to a much larger evaluation class.
EnsembleSizeRun, baseModelRun, RandomizeRun and dataRun

Each comboBox is assigned an actionListener which builds a string and depending on the currently selected items in each comboBox and outputs it to label6, This bit works and outputs like you would expect!

So what i need is instead for it to take in the position of the currently selected value in each comboBox say position 2 of EnsembleSize and it will then look up its corresponding array EnsembleSizeRun[2] and outputting this value out to label6 instead. I would like this to happen in all the actionListeners

And the reason im doing is just to show users more simpler form of the arguments instead what I would actually pass

EXAMPLE
Choosing ensemble size "x 5" instead of showing the user "-E 5 -N 5" which would be the argument I would be passing later on

Does this make sense? Any help please!!!


CODE:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

public class Menu extends JPanel implements ActionListener
{
private JButton Reset;
private JButton Run;
private JLabel label1;
private JLabel label2;
private JLabel label3;
private JLabel label4;
private JLabel label5;
private JLabel label6;
private JLabel label7;
private JComboBox EnsembleSize = null;
private JComboBox Randomize;
private JComboBox baseModel = null;
private JComboBox dataChoices;
final static int START_INDEX = 0;
private String Configs;
private String[] baseModelRun;
private String[] dataRun;
private String[] EnsembleSizeRun;
private String[] RandomizeRun;


public Menu()
{
constructComboBoxs();
constructComponents();
addComponents();
positionComponents();


// Set ActionListeners
Run.setActionCommand("RunButton");
Run.addActionListener(this);
Reset.setActionCommand("ResetButton");
Reset.addActionListener(this);

EnsembleSize.setActionCommand("ensemble");
EnsembleSize.addActionListener(this);
baseModel.setActionCommand("base");
baseModel.addActionListener(this);
Randomize.setActionCommand("random");
Randomize.addActionListener(this);
dataChoices.setActionCommand("data");
dataChoices.addActionListener(this);



}

public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("RunButton"))
{
label5.setText("<html><font color=red>RUNNING NOW!!!</font></html>");
label6.setText("Configs: "+EnsembleSize.getItemAt(EnsembleSize.getSelectedIndex())
+ " - " + baseModel.getItemAt(baseModel.getSelectedIndex()) + " - "
+ Randomize.getItemAt(Randomize.getSelectedIndex()) + " - "
+ dataChoices.getItemAt(dataChoices.getSelectedIndex()));
EnsembleSize.setEnabled(false);
baseModel.setEnabled(false);
Randomize.setEnabled(false);
dataChoices.setEnabled(false);

}
else if(e.getActionCommand().equals("ResetButton"))
{
Toolkit.getDefaultToolkit().beep();
label5.setText("");
label6.setText("Configs: ");
EnsembleSize.setEnabled(true);
baseModel.setEnabled(true);
Randomize.setEnabled(true);
dataChoices.setEnabled(true);
EnsembleSize.setSelectedIndex(0);
baseModel.setSelectedIndex(0);
Randomize.setSelectedIndex(0);
dataChoices.setSelectedIndex(0);
}
else if(e.getActionCommand().equals("ensemble"))
{
label6.setText("Configs: " + baseModel.getItemAt(baseModel.getSelectedIndex()) + " - "
+ Randomize.getItemAt(Randomize.getSelectedIndex()) + " - "
+ dataChoices.getItemAt(dataChoices.getSelectedIndex()) + " - "
+ EnsembleSize.getItemAt(EnsembleSize.getSelectedIndex()) );

/*System.out.print(EnsembleSize.getItemAt(EnsembleSize.getSelectedIndex()));
String bob = EnsembleSizeRun[EnsembleSize.getSelectedIndex()];
System.out.print(bob);*/
}


else if(e.getActionCommand().equals("base"))
{
label6.setText("Configs: " + baseModel.getItemAt(baseModel.getSelectedIndex()) + " - "
+ Randomize.getItemAt(Randomize.getSelectedIndex()) + " - "
+ dataChoices.getItemAt(dataChoices.getSelectedIndex()) + " - "
+ EnsembleSize.getItemAt(EnsembleSize.getSelectedIndex()) );
}
else if(e.getActionCommand().equals("random"))
{
label6.setText("Configs: " + baseModel.getItemAt(baseModel.getSelectedIndex()) + " - "
+ Randomize.getItemAt(Randomize.getSelectedIndex()) + " - "
+ dataChoices.getItemAt(dataChoices.getSelectedIndex()) + " - "
+ EnsembleSize.getItemAt(EnsembleSize.getSelectedIndex()) );
}
else if(e.getActionCommand().equals("data"))
{
label6.setText("Configs: " + baseModel.getItemAt(baseModel.getSelectedIndex()) + " - "
+ Randomize.getItemAt(Randomize.getSelectedIndex()) + " - "
+ dataChoices.getItemAt(dataChoices.getSelectedIndex()) + " - "
+ EnsembleSize.getItemAt(EnsembleSize.getSelectedIndex()) );
}
}


void constructComboBoxs()
{
// construct preComponents with arrays for comboBoxs
String[] EnsembleSizeItems = {" x 1", " x 5", " x 10"};
String[] RandomizeItems = {"Compare all methods"," Random Features", " Random Sampling", " Randomise Outputs"};
String[] baseModelItems = {"Nearest Neighbour", "Linear Regression", "M5P Tree"};
String[] DataItems = {"autoprice", "BreastTumor", "cholesterol", "housing","pollution"};

String[] EnsembleSizeRun = {" -E 1 -N 5", " -E 5 -N 5", " -E 10 -N 5"};
String[] RandomizeRun = {""," -S 0"," -S 1"," -S 2"};
String[] baseModelRun = {"research.predictors.knn",
"weka.classifiers.LinearRegression",
"weka.classifiers.trees.M5P"};

String[] dataRun = {"-c 16 -t \"C://ensembleResearchNew//data//autoprice.arff\"",
"-c 10 -t \"C://ensembleResearchNew//data//BreastTumor.arff\"",
"-c 14 -t \"C://ensembleResearchNew//data//cholesterol.arff\"",
"-c 14 -t \"C://ensembleResearchNew//data//housing.arff\"",
"-c 16 -t \"C://ensembleResearchNew//data//pollution.arff\""};


// construct components
baseModel = new JComboBox(baseModelItems);
baseModel.setSelectedIndex(START_INDEX);
EnsembleSize = new JComboBox (EnsembleSizeItems);
EnsembleSize.setSelectedIndex(0);
Randomize = new JComboBox (RandomizeItems);
Randomize.setSelectedIndex(2);
dataChoices = new JComboBox (DataItems);
dataChoices.setSelectedIndex(0);


// constructs configurations for running experiment
/*Configs = (baseModelRun[baseModel.getSelectedIndex()] + " "
+ dataRun[dataChoices.getSelectedIndex()]
+ EnsembleSizeRun[EnsembleSize.getSelectedIndex()]
+ RandomizeRun[Randomize.getSelectedIndex()]);*/

}

void constructComponents()
{
// constructs labels
label1 = new JLabel ("<html><font color=red size=10>MAIN MENU</font></html>");
label2 = new JLabel ("Select size of ensemble:");
label3 = new JLabel ("Select a Base Model:");
label4 = new JLabel ("Select randomising method:");
label5 = new JLabel ();
label6 = new JLabel ();
label7 = new JLabel ("Select data set:");

// constructs buttons
Reset = new JButton ("Reset");
Run = new JButton ("Run!");
}


void addComponents()
{
//adds comboBoxs
add (EnsembleSize);
add (Randomize);
add (baseModel);
add (dataChoices);

//adds labels
add (label1);
add (label2);
add (label3);
add (label4);
add (label5);
add (label6);
add (label7);

//add buttons
add (Reset);
add (Run);

//add message hints to buttons
Run.setToolTipText("Press this button to run experiment");
Reset.setToolTipText("Press this button to reset all options for experiment");
}


void positionComponents()
{

// Sets size and set layout for panel
setPreferredSize (new Dimension (420, 400));
setLayout (null);

/*************************************************************
*sets component bounds for Absolute Positioning of components*
* setup guide = name.setBounds(x1, y, x2, height) *
*************************************************************/

//sets positions for combo boxes
EnsembleSize.setBounds (225, 60, 60, 25);
Randomize.setBounds (225, 170, 150, 25);
baseModel.setBounds (225, 115, 137, 25);
dataChoices.setBounds (225, 225, 150, 25);

//sets positions for labels on panel
label1.setBounds (100, 0, 300, 40);
label2.setBounds (65, 60, 145, 25);
label3.setBounds (80, 114, 122, 25);
label4.setBounds (42, 170, 166, 25);
label5.setBounds (175, 350, 100, 25);//RUNNING NOW!!!
label6.setBounds (10, 275, 700, 25);//configs
label7.setBounds (110, 225, 150, 25);

//sets positions for buttons on panel
Reset.setBounds (125, 315, 100, 20);
Run.setBounds (215, 315, 100, 20);
}


public static void main(String[] args)
{
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame ("JPanel Preview");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add (new Menu());
frame.pack();
frame.setVisible (true);
}
}