Uses 0K of libraries. Click here for Pure Java version (15576L/107K).
1 | !7 |
2 | |
3 | !include once #1016163 // JxBrowser with tabs |
4 | |
5 | sclass JavaChrome extends DynModule { |
6 | transient BrowserContext browserContext; |
7 | transient TabbedPane tabbedPane; |
8 | |
9 | void start { |
10 | // Solve protection domain problem |
11 | // dm_initClass(java.util.prefs.FileSystemPreferences.class); |
12 | |
13 | setModuleName("Java Chrome - based on JxBrowser"); |
14 | jxBrowser_init(); |
15 | L existingInstances = dm_modulesOfType('JavaChrome); |
16 | existingInstances.remove(this); |
17 | if (nempty(existingInstances)) { |
18 | browserContext = (BrowserContext) get(first(existingInstances), 'browserContext); |
19 | print("Using existing browser context: " + browserContext); |
20 | } else |
21 | browserContext = jxBrowserStandardContext(); |
22 | } |
23 | |
24 | JComponent visualize() { |
25 | ret swing(func -> JComponent { |
26 | tabbedPane = new TabbedPane(browserContext); |
27 | tabbedPane.addAndSelectTab(TabFactory.createTab(browserContext, "http://BotCompany.de")); |
28 | ret tabbedPane; |
29 | }); |
30 | } |
31 | |
32 | void unvisualize() { |
33 | if (tabbedPane != null) |
34 | tabbedPane.disposeAllTabs(); |
35 | tabbedPane = null; |
36 | } |
37 | } |
Began life as a copy of #1016164
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, zkbeyrirjpvi
No comments. add comment
Snippet ID: | #1016166 |
Snippet name: | Java Chrome [Dyn Module, uses JxBrowser which needs a license] |
Eternal ID of this version: | #1016166/19 |
Text MD5: | 4c329e3bd2ccd9bb91a86d8680435675 |
Transpilation MD5: | 6af94d28d395b27fb04beb6da8bd2f21 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-11-26 00:35:43 |
Source code size: | 1121 bytes / 37 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 521 / 1387 |
Version history: | 18 change(s) |
Referenced in: | [show references] |