Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

37
LINES

< > BotCompany Repo | #1016166 // Java Chrome [Dyn Module, uses JxBrowser which needs a license]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 0K of libraries. Click here for Pure Java version (15576L/107K).

!7

!include once #1016163 // JxBrowser with tabs

sclass JavaChrome extends DynModule {
  transient BrowserContext browserContext;
  transient TabbedPane tabbedPane;
  
  void start {
    // Solve protection domain problem
    // dm_initClass(java.util.prefs.FileSystemPreferences.class);
    
    setModuleName("Java Chrome - based on JxBrowser");
    jxBrowser_init();
    L existingInstances = dm_modulesOfType('JavaChrome);
    existingInstances.remove(this);
    if (nempty(existingInstances)) {
      browserContext = (BrowserContext) get(first(existingInstances), 'browserContext);
      print("Using existing browser context: " + browserContext);
    } else
      browserContext = jxBrowserStandardContext();
  }
  
  JComponent visualize() {
    ret swing(func -> JComponent {
      tabbedPane = new TabbedPane(browserContext);
      tabbedPane.addAndSelectTab(TabFactory.createTab(browserContext, "http://BotCompany.de"));
      ret tabbedPane;
    });
  }
  
  void unvisualize() {
    if (tabbedPane != null)
      tabbedPane.disposeAllTabs();
    tabbedPane = null;
  }
}

Author comment

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: 339 / 1139
Version history: 18 change(s)
Referenced in: [show references]