Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

whats the status of swing? can we port old applets easily? multi-threading or am i dreaming?


I think Swing is a non-goal of this project. It provides good interop with the DOM and core JS methods, and it makes it easy to create your own interop for JS apis that aren't in the core.

There are at least two GUI toolkits that run on TeaVM: 1. Codename One. Similar to swing, but focused on mobile https://www.codenameone.com 2. SnapKit. Targeted at desktop. Also a light-weight toolkit, like Swing. https://github.com/reportmill/SnapKit


> I think Swing is a non-goal of this project.

It could work though by drawing to canvas.

That's what Avalonia does in C#: https://avaloniaui.net/

Here's a clone of Visual Basic 6 written with Avalonia and compiled to WebAssembly:

https://bandysc.github.io/AvaloniaVisualBasic6/

https://github.com/BAndysc/AvaloniaVisualBasic6


No Swing support at present. There is an issue filed, but it is in need of an implementer: https://github.com/konsoletyper/teavm/issues/406

I made a general guide for migrating from Swing to TeaVM here: https://frequal.com/TeaVM/migration/MigratingFromSwingToTeaV...

For a more specific example, I ported an open-source Java applet and described the process here: https://frequal.com/java/RestoringA19YearOldGameWithTeaVm.ht...


If that's your goal, you should look at CheerpJ, which supports Swing and has the goal of making it so you can easily port applets and other existing apps to the web.

I think TeaVM is more focused on letting you share code with the web instead of porting entire apps.


You can use Codename One whose web port is based on TeaVM. The API is very much like Swing. Albeit more focused on mobile.


+1 for for Codename One. It is the only tool I use when I need a mobile-only app. I have built numerous apps using Codename One, and have released 2 of them in app stores. Great Swing-like API, great examples, great documentation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: