1

I have a Java application which displays results on a JPanel. The results are displayed using HTML by using a JLabel.

Now I want to let the user interact with the local application by allowing local methods to be called when the user clicks on a link in that HTML document.

Is this possible?

Kevin Panko
  • 8,356
  • 19
  • 50
  • 61
ChimstarTech
  • 73
  • 2
  • 8

1 Answers1

1

To answer you question, then, it is possible, however you cannot use a JLabel, you need to insert a JavaFX component, and then you can set your class as a window variable on the DOM, and thus your methods can be called from JavaScript.

Have a look at this answer on this question. It looks like they are doing exactly what you want.

Community
  • 1
  • 1
Paul Wagland
  • 27,756
  • 10
  • 52
  • 74