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

19
LINES

< > BotCompany Repo | #1034757 // indexOfTabComponent - takes component contained in title or tab contents

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (11311L/64K).

1  
static int indexOfTabComponent(JTabbedPane tabs, Component c) swing {
2  
  if (tabs == null || c == null) ret -1;
3  
  int n = tabs.getTabCount();
4  
  for i to n:
5  
    if (isGrandChildOf_limitedBy(c, tabs.getTabComponentAt(i), tabs)
6  
      || isGrandChildOf_limitedBy(c, tabs.getComponentAt(i), tabs))
7  
      ret i;
8  
  ret -1;
9  
}
10  
11  
static int indexOfTabComponent(JExtendedTabbedPane tabs, Component c) swing {
12  
  if (tabs == null || c == null) ret -1;
13  
  int n = tabs.getTabCount();
14  
  for i to n:
15  
    if (isGrandChildOf_limitedBy(c, tabs.getTabComponentAt(i), tabs.visualize())
16  
      || isGrandChildOf_limitedBy(c, tabs.getComponentAt(i), tabs.visualize()))
17  
      ret i;
18  
  ret -1;
19  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034757
Snippet name: indexOfTabComponent - takes component contained in title or tab contents
Eternal ID of this version: #1034757/3
Text MD5: f749bff663188c47cd21716a3bc1820a
Transpilation MD5: 38a3d00eb4c5b5569ab324b75899c817
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-13 19:23:34
Source code size: 684 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 67 / 124
Version history: 2 change(s)
Referenced in: [show references]