Commit e399cd9
swingjs/a2s/_README.txt
The swingjs/a2s/* AWT/Swingjs adapter classes were moved
from a2s/* on 10/23/2018.
The swingjs/a2s package provides a method of using non-Swing AWT
components (Button, TextField, etc.) even though SwingJS requires
Swing components (JButton, JTextField, etc.). This is necessary because
SwingJS does not implement "mixed-mode" containers -- JPanels that have
AWT Buttons, for example. This possibility was clearly a nightmare for
Swing developers, and the code backing this capability was just way too
complex to even consider converting.
There is probably a reason this was never done before, but I have not
discovered it yet. That is to say, this works.
The intent is to provide a means of taking a project that is not
a Swing application or does not fully use Swing components and make it
work
in SwingJS with no special handling. In Java, a reference to
"java.awt.Button"
is just that. In JavaScript, that call is to a javax.swing.JButton via
the intermediary swingjs.a2s.Button.
It is still recommended to convert a non-Swing application or applet
prior to
working with SwingJS, because it is not guaranteed that this
implementation is
complete.
But, that said, this does work. Older AWT mouse events are passed on to
the
component as before, even though they are also passed on by the listener
mechanism introduced in Swing.1 parent c1a13c8 commit e399cd9
1 file changed
+18
-14
lines changedLines changed: 18 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | | - | |
18 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | | - | |
21 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 29 | + | |
| 30 | + | |
0 commit comments