swing-ui 0.1.25 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/LICENSE +5 -4
  2. package/README.md +144 -7
  3. package/SwingUI.js +2611 -0
  4. package/classes/Arc.js +185 -0
  5. package/classes/Button.js +55 -0
  6. package/classes/CheckBox.js +33 -0
  7. package/classes/CheckBoxMenuItem.js +24 -0
  8. package/classes/ComboBox.js +329 -0
  9. package/classes/ComponentContainer.js +828 -0
  10. package/classes/ContextMenu.js +141 -0
  11. package/classes/DocumentEditor.js +168 -0
  12. package/classes/Ellipse.js +76 -0
  13. package/classes/InternalWindow.js +397 -0
  14. package/classes/InternalWindowContainer.js +93 -0
  15. package/classes/Label.js +52 -0
  16. package/classes/Line.js +105 -0
  17. package/classes/List.js +452 -0
  18. package/classes/MediaPlayer.js +504 -0
  19. package/classes/Menu.js +74 -0
  20. package/classes/MenuBar.js +56 -0
  21. package/classes/MenuItem.js +92 -0
  22. package/classes/Panel.js +50 -0
  23. package/classes/PasswordField.js +47 -0
  24. package/classes/Polygon.js +236 -0
  25. package/classes/Polyline.js +240 -0
  26. package/classes/ProgressBar.js +62 -0
  27. package/classes/RadioButton.js +110 -0
  28. package/classes/RadioButtonMenuItem.js +106 -0
  29. package/classes/Rectangle.js +199 -0
  30. package/classes/ScrollPane.js +53 -0
  31. package/classes/ScrollableComponent.js +141 -0
  32. package/classes/Separator.js +24 -0
  33. package/classes/Shape.js +584 -0
  34. package/classes/ShapeContainer.js +231 -0
  35. package/classes/Slider.js +172 -0
  36. package/classes/Spinner.js +172 -0
  37. package/classes/SplitView.js +82 -0
  38. package/classes/Stroke.js +115 -0
  39. package/classes/Table.js +982 -0
  40. package/classes/Tabs.js +228 -0
  41. package/classes/TextArea.js +125 -0
  42. package/classes/TextComponent.js +207 -0
  43. package/classes/TextField.js +128 -0
  44. package/classes/TextShape.js +123 -0
  45. package/classes/ToggleButton.js +147 -0
  46. package/classes/ToolBar.js +120 -0
  47. package/classes/TrayIcon.js +54 -0
  48. package/classes/Tree.js +569 -0
  49. package/classes/UIComponent.js +2113 -0
  50. package/classes/Window.js +609 -0
  51. package/enums.js +298 -0
  52. package/fonts.conf +32 -0
  53. package/functions.js +254 -0
  54. package/icon.png +0 -0
  55. package/index.js +109 -4
  56. package/jar/gui-11.jar +0 -0
  57. package/jar/lib/flatlaf.jar +0 -0
  58. package/jar/lib/jna.jar +0 -0
  59. package/package.json +58 -33
  60. package/typedefs.js +973 -0
  61. package/types/SwingUI.d.ts +727 -0
  62. package/types/classes/Arc.d.ts +111 -0
  63. package/types/classes/Button.d.ts +38 -0
  64. package/types/classes/CheckBox.d.ts +22 -0
  65. package/types/classes/CheckBoxMenuItem.d.ts +18 -0
  66. package/types/classes/ComboBox.d.ts +172 -0
  67. package/types/classes/ComponentContainer.d.ts +131 -0
  68. package/types/classes/ContextMenu.d.ts +74 -0
  69. package/types/classes/DocumentEditor.d.ts +95 -0
  70. package/types/classes/Ellipse.d.ts +34 -0
  71. package/types/classes/InternalWindow.d.ts +163 -0
  72. package/types/classes/InternalWindowContainer.d.ts +36 -0
  73. package/types/classes/Label.d.ts +33 -0
  74. package/types/classes/Line.d.ts +48 -0
  75. package/types/classes/List.d.ts +223 -0
  76. package/types/classes/MediaPlayer.d.ts +381 -0
  77. package/types/classes/Menu.d.ts +43 -0
  78. package/types/classes/MenuBar.d.ts +26 -0
  79. package/types/classes/MenuItem.d.ts +57 -0
  80. package/types/classes/Panel.d.ts +28 -0
  81. package/types/classes/PasswordField.d.ts +22 -0
  82. package/types/classes/Polygon.d.ts +93 -0
  83. package/types/classes/Polyline.d.ts +96 -0
  84. package/types/classes/ProgressBar.d.ts +36 -0
  85. package/types/classes/RadioButton.d.ts +70 -0
  86. package/types/classes/RadioButtonMenuItem.d.ts +71 -0
  87. package/types/classes/Rectangle.d.ts +82 -0
  88. package/types/classes/ScrollPane.d.ts +23 -0
  89. package/types/classes/ScrollableComponent.d.ts +81 -0
  90. package/types/classes/Separator.d.ts +14 -0
  91. package/types/classes/Shape.d.ts +223 -0
  92. package/types/classes/ShapeContainer.d.ts +92 -0
  93. package/types/classes/Slider.d.ts +107 -0
  94. package/types/classes/Spinner.d.ts +129 -0
  95. package/types/classes/SplitView.d.ts +47 -0
  96. package/types/classes/Stroke.d.ts +99 -0
  97. package/types/classes/Table.d.ts +652 -0
  98. package/types/classes/Tabs.d.ts +118 -0
  99. package/types/classes/TextArea.d.ts +45 -0
  100. package/types/classes/TextComponent.d.ts +136 -0
  101. package/types/classes/TextField.d.ts +94 -0
  102. package/types/classes/TextShape.d.ts +73 -0
  103. package/types/classes/ToggleButton.d.ts +84 -0
  104. package/types/classes/ToolBar.d.ts +82 -0
  105. package/types/classes/TrayIcon.d.ts +43 -0
  106. package/types/classes/Tree.d.ts +354 -0
  107. package/types/classes/UIComponent.d.ts +945 -0
  108. package/types/classes/Window.d.ts +334 -0
  109. package/types/enums.d.ts +437 -0
  110. package/types/functions.d.ts +109 -0
  111. package/types/index.d.ts +188 -0
  112. package/types/typedefs.d.ts +1626 -0
  113. package/ui-process-manager.js +317 -0
  114. package/video-devices-linux.sh +72 -0
  115. package/video-devices-mac.sh +33 -0
  116. package/CHANGES.md +0 -3
package/LICENSE CHANGED
@@ -1,13 +1,14 @@
1
1
  Custom License Agreement
2
2
 
3
- Copyright (c) Dmitriy Kulikovskiy
3
+ Copyright (c) eSoftie LLC
4
4
 
5
- 1. You are allowed to use the code for personal purposes. For commercial license contact the author.
6
- 2. You are not allowed to modify, distribute, or sell the code, in whole or in part.
5
+ 1. You are allowed to use the module for Personal use, or Commercial use if Commercial license is obtained from swing-ui.com
6
+ 2. You are not allowed to modify, decompile, distribute, or sell the code, in whole or in part.
7
7
  3. For more details contact support@esoftie.com
8
8
 
9
9
  Permission to use this software for personal use hereby granted, provided that the above
10
- copyright notice and this permission notice appear in all copies.
10
+ copyright notice and this permission notice appear in all copies. Complete terms of use and privacy policy
11
+ is provided at swing-ui.com and may change without notice.
11
12
 
12
13
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13
14
  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
package/README.md CHANGED
@@ -1,7 +1,144 @@
1
- # NOTE: This module is not fully published yet. I am in the process of publishing it. Check official site to see the progress **https://swing-ui.com**.
2
-
3
-
4
-
5
- ## So...
6
-
7
- Check back later to be the first try it out. I love this UI and I am sure you will find it useful as well.
1
+ # `swing-ui` GUI Module
2
+
3
+ **Build real cross-platform desktop apps in JavaScript — no Electron, no Chromium, no browser, no HTML/CSS**, no React/Angular/Svelte/Vue. **No back-end / front-end mess**.
4
+
5
+ Build once, run it on Windows, Linux and macOS in your favorite JavaScript runtime: Node.js, Bun, or Deno 2+.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/swing-ui.svg)](https://www.npmjs.com/package/swing-ui)
8
+ ![Node | Bun | Deno](https://img.shields.io/badge/runtime-Node.js%20%7C%20Bun%20%7C%20Deno%202%2B-brightgreen)
9
+ ![Windows | macOS | Linux](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-blue)
10
+ [![npm license](https://img.shields.io/npm/l/swing-ui.svg)](https://www.npmjs.com/package/swing-ui)
11
+
12
+ `swing-ui` wraps and upgrades the full Java Swing library so you can write native-looking, cross-platform desktop applications entirely in JavaScript using the JS runtime you already know: Node.js, Bun or Deno 2+.
13
+
14
+ You only write JavaScript and the GUI gets built, or better yet, use our [Visual GUI Designer](https://swing-ui.com/visual-gui-designer/) to skip coding at all.
15
+
16
+ Try it in your project: `npm install swing-ui`.
17
+
18
+ For quick onboarding check out swing-ui.com [Getting Started](https://swing-ui.com/installation/) guide and [API reference](https://swing-ui.com/jsdocs.php).
19
+
20
+ ---
21
+
22
+ > Finally, JavaScript is no longer for web browser and server back end. Now its for desktop apps too.
23
+
24
+ ## Problems with building JavaScript desktop apps without `swing-ui`
25
+
26
+ If you've shipped a desktop app in JS before, you've probably lived one of these:
27
+
28
+ - **Electron works, but it's heavy, require HTML, CSS, ....** Every app ships its own copy of Chromium and Node, so installers balloon past 100–150 MB and even simple apps chew through RAM before you've drawn a single window.
29
+ - **The "lightweight" alternatives mean leaving JavaScript.** Native performance and a small footprint usually mean learning Qt, WinForms, or raw Swing/AWT in a completely different language and ecosystem.
30
+ - **HTML/CSS UIs never quite feel native.** Buttons, menus, and dialogs built in a webview look and behave like a webpage wearing a desktop costume, not a real OS application.
31
+ - **Back-end/front-end confusion and management makes coding horrible.** Now it's just one JavaScript code like it should be.
32
+ - **Asynchronous request calls to UI components from main application logic are messy.** `swing-ui` provides a synchronous deterministic code execution, so that when you request a text from a component in your main application logic code, you can use the returned text in your next line of code without using `await`, Promise and a callback function.
33
+
34
+ `swing-ui` removes those issues. You get a **real native OS windows and UI components from enhanced Java Swing library** and you don't have to write a single line of Java code, HTML or CSS. Write your UI in plain JavaScript, or simply design the UI in our free **[swing-ui Visual GUI Designer](https://swing-ui.com/visual-gui-designer/)**.
35
+
36
+ ![swing-ui under the hood](https://swing-ui.com/wp-content/uploads/2026/04/3D-swing-ui-stack-244x300.png)
37
+
38
+ ---
39
+
40
+ ## Why developers love `swing-ui` GUI module
41
+
42
+ - **No browser engine, no markup.** No Chromium bundled into your build, no HTML, no CSS — just JavaScript, or the visual GUI Designer if you'd rather not hand-position pixels.
43
+ - **It's just JavaScript, with a chainable API.** Every component returns itself, so building UI reads like jQuery, not like fighting a framework:
44
+
45
+ ```js
46
+ const saveButton = new Button("Save").position(15, 50).size(100, 30)
47
+ .addTo(window)
48
+ .onAction(e => save());
49
+ ```
50
+
51
+ - **[JavaScript API](https://swing-ui.com/jsdocs.php) is super easy, intuitive, and well documented**. Quick onboarding docs and API reference is at [swing-ui.com](https://swing-ui.com).
52
+ - **Simple synchronous code execution**. No need to use `await` or callback function to get Ui component property or value.
53
+ - **For your convenience complex low level stuff is highly simplified without much compromise**. For example features like drag-and-drop, undo/redo, clipboard management, table manipulation, images support and much more.
54
+ - **Looks native, not just close.** swing-ui can opt into your OS's system look-and-feel, so windows and controls take on native Windows, macOS, or Linux styling instead of a generic default theme.
55
+ - **The full Java Swing component library, from JS.** Tables with sorting, filtering, column reordering and hiding; trees, tabs, and split views; rich clipboard and drag-and-drop support — including MIME types, both within your app and to/from other applications; full icon and image support across JPG, PNG, GIF, BMP, ICO, TIFF, HEIC, WEBP, AVIF; and deep event handling for actions, mouse, scrolling, resizing, and more.
56
+ - **Runs on the runtime you already picked.** First-class support for **Node.js, Bun, and Deno 2+** — same API, same imports.
57
+ - **Synchronous where it should be.** GUI calls, file reads/writes, clipboard access — no unnecessary `await` and callbacks for things that don't need it.
58
+ - **One honest dependency.** swing-ui needs a Java 11+ JDK on the system PATH to power the native rendering — the whole trade-off for skipping Chromium. It's light enough to run on a $5 Raspberry Pi Zero, just slower than on a desktop.
59
+ - **Multiple UI themes available.** In addition to few themes build into Java, like `metal` or system look-and-feel, `swing-ui` includes beautiful `FlatLaf` themes (light and dark) from https://www.formdev.com/flatlaf/.
60
+ - **AI already writes apps with `swing-ui` GUI using our pre-made skill and GUI definition file schema**.
61
+
62
+ ---
63
+
64
+ ## Quick look
65
+
66
+ ```bash
67
+ npm install swing-ui
68
+ ```
69
+
70
+ > Install it locally in each project — not with `-g`.
71
+
72
+ ```js
73
+ import "swing-ui";
74
+
75
+ class HelloApp extends Window {
76
+ constructor() {
77
+ super("swing-ui Demo");
78
+ this.innerSize(360, 160).position(200, 200).closeOperation(Window.CloseOperation.Exit);
79
+
80
+ new Label("What's your name?").position(20, 20).addTo(this);
81
+ const name = new TextField("type name here").size(300, 28).position(20, 45).addTo(this);
82
+
83
+ new Button("Greet me").position(20, 85).addTo(this)
84
+ .onAction(e => alert(`Hello, ${name.text()}!`));
85
+
86
+ this.show();
87
+ }
88
+ }
89
+
90
+ globalThis.HelloApp = new HelloApp();
91
+ ```
92
+
93
+ Run it with `node index.js` (or `bun index.js` / `deno run index.js`) and you get a real, resizable, native OS window — not a browser tab.
94
+
95
+ That's just a taste. Tables, trees, tabs, menus, system tray icons, custom drawing, and the full component API are all covered in the docs.
96
+
97
+ ---
98
+
99
+ ## See it in action
100
+
101
+ - A [notes app built entirely with swing-ui](https://swing-ui.com/wp-content/uploads/2024/09/swing-ui-based-notes-application.jpg) — a real simple example of what you can ship
102
+ - Our [Visual GUI Designer](https://swing-ui.com/wp-content/uploads/2026/04/GUI-Designer-1.png) was build entirely in JavaScript with `swing-ui` GUI module.
103
+ ---
104
+
105
+ ## What people build with it
106
+
107
+ - Internal tools
108
+ - Admin dashboards
109
+ - Data-entry apps
110
+ - File and asset managers
111
+ - Monitoring utilities
112
+ - Small line-of-business apps
113
+ - Simple graphical games using shapes API
114
+ - Vector drawing apps
115
+ - Industrial control software
116
+ - CNC software
117
+ - Financial software with graphical graphs and charts
118
+ - and much more...
119
+
120
+ Anywhere you want a real desktop app without the weight of a browser runtime, and without leaving JavaScript to get it. With thousands or JavaScript modules now almost anything is possible in JavaScript.
121
+
122
+ ---
123
+
124
+ ## Requirements
125
+
126
+ - Windows, Linux, or macOS
127
+ - Node.js 18+, Bun 1.1+, or Deno 2+
128
+ - Java 11+ JDK, with `java` available on the system `PATH`
129
+ - 1 GHz processor and 500 MB RAM or more - light enough to even run on a $5 Raspberry Pi Zero
130
+ - ECMAScript Module (ESM) mode only (`"type": "module"` in `package.json`)
131
+
132
+ ---
133
+
134
+ ## Docs
135
+
136
+ This README is just the pitch. Everything else lives at **[swing-ui.com](https://swing-ui.com)**:
137
+
138
+ - Quick onboarding guide — go from `npm install` to `swing-ui` expert in no time
139
+ - Full JavaScript API reference, class by class
140
+ - Coding style and patterns explained, theming, Visual GUI Designer, and UI-definition-file guides
141
+ - More examples
142
+
143
+ Found a bug? [Report it here](https://swing-ui.com/report-bug/) — every report gets reviewed and helps to make `swing-ui` even better.
144
+