I need to make a simple refresh button for a gui java program I have the button made but its not working properly. I just am not sure what the code needs to be to make the button work. Any help would be really appreciated.I figured the code below
`
refeshButton.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(Button button, EventObject e) {
// Window.alert("text" + button.getText());
if (button.getText().equals("Refresh")) {
sendDataToServ1("Refresh");
}
}
public void sendDataToServ1(String action) {
System.out.println("ACTION :----->" + action);
AsyncCallback<com.viji.example.domain.Record> callback = new AsyncCallback<com.viji.example.domain.Record>() {
@Override
public void onFailure(Throwable caught) {
System.out.println("Failure");
}
public void onSuccess(com.viji.example.domain.Record result) {
CompanySampledetails(result, 1);
}
};
if (action.trim().equals("Refresh")) {
System.out.println("Before Refresh");
dbService.getRecords(callback);
}
}
});