I'm trying to create frames with JArchi.
The Frame is created. However, it seems that the events are not captured.
Not possible to close the windows clicking on the close window button at the top left side of the window.
Nothing happen when clicking on the button.
Any idea concerning the ability to capture the events?
The code looking like:
var JFrame = Java.type("javax.swing.JFrame");
var JPanel = Java.type("javax.swing.JPanel");
var JButton = Java.type("javax.swing.JButton");
var JLabel = Java.type("javax.swing.JLabel");
var BorderLayout = Java.type('java.awt.BorderLayout');
var ActionListener = Java.type('java.awt.event.ActionListener');
var win = new JFrame("My Window");
var panel = new JPanel();
var button = new JButton('Click me!');
javax.swing.JOptionPane.showMessageDialog(frame, "Hello World!");
BTW, what are you trying to achieve (there might be alternative way of doing it, like simply opening a browser tab) ?
in line with JB's comments, mixing Java Swing and AWT with Eclipse SWT via Nashorn will lead to problems. In this case it is to do with different threading and event queues. Better to stick to only SWT components.
See post https://forum.archimatetool.com/index.php?topic=843.msg4660#msg4660
for example of creating/using a dialog box in SWT thru jArchi