There are two JEdits edPrice and edPriceTill. If first JEdit is empty then second must be editable=false. I tried like this
--------------------------
DocumentListener priceDocListener = new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
doCheck();
}
public void removeUpdate(DocumentEvent e) {
doCheck();
}
public void insertUpdate(DocumentEvent e) {
doCheck();
}
private void doCheck() {
// HERE I NEED TO INSERT IT
// e.getChange(elem);
if(price.getText().length()<=0) {
priceTill.setEditable(false);
priceTill.setText("");
} else {
priceTill.setEditable(true);
}
}
};
--------------------------
Now I need to allow this edit to recieve only numbers and '.'. It seems to be done using
e.getChange(elem);
but it requires `elem` as parameter, where can i get it? Or am i wrong.