I am currently utilizing JxBrowser within a Java application to run an index.html file as a graphical user interface for inputting and displaying values.
My goal is to dynamically update an HTML form from my Java application by implementing the following code:
browser.addLoadListener(new LoadAdapter() {
@Override
public void onFinishLoadingFrame(FinishLoadingEvent event) {
if (event.isMainFrame()) {
DOMDocument document = event.getBrowser().getDocument();
DOMFormControlElement element =
(DOMFormControlElement) document.findElement(By.id("textArea"));
DOMFormControlElement textArea = (DOMFormControlElement) element;
DOMEventType.OnChange;
if (!MessagefromCSM.equals("CSM request pending")) {
textArea.setValue(MessagefromCSM);
}
}
}
});
While this method works seamlessly during launch, displaying the string value from MessagefromCSM correctly, it unfortunately remains static. Is there any way to update the textArea's content at will?
Thank you in advance for any suggestions,
Olivier