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).

static int indexOfTabComponent(JTabbedPane tabs, Component c) swing {
  if (tabs == null || c == null) ret -1;
  int n = tabs.getTabCount();
  for i to n:
    if (isGrandChildOf_limitedBy(c, tabs.getTabComponentAt(i), tabs)
      || isGrandChildOf_limitedBy(c, tabs.getComponentAt(i), tabs))
      ret i;
  ret -1;
}

static int indexOfTabComponent(JExtendedTabbedPane tabs, Component c) swing {
  if (tabs == null || c == null) ret -1;
  int n = tabs.getTabCount();
  for i to n:
    if (isGrandChildOf_limitedBy(c, tabs.getTabComponentAt(i), tabs.visualize())
      || isGrandChildOf_limitedBy(c, tabs.getComponentAt(i), tabs.visualize()))
      ret i;
  ret -1;
}

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: 17 / 57
Version history: 2 change(s)
Referenced in: [show references]