View Single Post
  #1 (permalink)  
Old 03-04-2008, 08:33 PM
Lehane_9 Lehane_9 is offline
Member
 
Join Date: Dec 2007
Posts: 6
Lehane_9 is on a distinguished road
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!!
Reply With Quote
Sponsored Links