2

How do i select a string from a drop list, and pass it to object class which is having array of string?

for example

In service class

JComboBox comboBox = new JComboBox();
    for (int i = 0; i < 3; i++)
    {
        comboBox.addItem(Rma.warrantyStatus[i]);    
    }
    comboBox.setBounds(123, 57, 116, 20);
    Add.add(comboBox);

In object class

String[] warrantyStatus = {"In warranty", "Out of warranty", "DOA"};

public String[] getWarrantyStatus() {
    return warrantyStatus;
}
public void setWarrantyStatus(String[] warrantyStatus) {
    this.warrantyStatus = warrantyStatus;
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433

0 Answers0