|
getting the value of variable
public void actionPerformed(ActionEvent e)
{
if (!txtBox.getText().equals("")){
int a = 0;
for(int i = 0; i < combo.getItemCount(); i++){
if(combo.getItemAt(i).equals(txtBox.getText())){
a = 1;
break;
}
}
if (a == 1)
JOptionPane.showMessageDialog(null,"Combo has already this item.");
else
combo.addItem(txtBox.getText());
// I want to store the value of txtBox.text(), to an array and then to a file,
if some could show me how to do this it would be appreciated as i have tried for about an hour and a half myself.
thank you in advance!!
|