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

22
LINES

< > BotCompany Repo | #1020847 // Tabs

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

Uses 911K of libraries. Click here for Pure Java version (8380L/44K).

!7

sclass Tab { S name; }

compact module Tabs {
  new L<Tab> tabs_actual;
  transient L<Tab> tabs;
  transient JTabbedPane jtabs;
  
  start { tabs = notifyingList(tabs_actual, r change + r updateTabs); }

  visualize {
    jtabs = jtabs(); updateTabs();
    ret withButtonsAbove(jtabs, "+", rThread { inputText("Name for new tab", vf<S> addTab) });
  }
  
  void updateTabs q { fillJTabs(jtabs, syncCollect name(tabs)); }
  
  // API
  
  void addTab(S name) { tabs.add(nu(Tab, +name)); }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020847
Snippet name: Tabs
Eternal ID of this version: #1020847/22
Text MD5: 4c0b4f654556675b91de841a358fa8ee
Transpilation MD5: 21b75751f1fd940a6fe7e9929a7225b1
Author: stefan
Category:
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-06 02:10:34
Source code size: 514 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 349 / 725
Version history: 21 change(s)
Referenced in: #1020860 - Editor Tabs v1 using JTabbedPane [pretty decent, but I want a different tab placement]