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

13
LINES

< > BotCompany Repo | #1027346 // getFocusOwningComboBox

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

Libraryless. Click here for Pure Java version (2407L/15K).

1  
static JComboBox getFocusOwningComboBox() {
2  
  ret swing(() -> {
3  
    Component focusOwner = getFocusOwner();
4  
    for (JComboBox cb : allSwingComponentsOfType(JComboBox.class)) {
5  
      ComboBoxEditor editor = cb.getEditor();
6  
      if (editor == null) continue;
7  
      Component c = cb.getEditor().getEditorComponent();
8  
      if (c == focusOwner)
9  
        ret cb;
10  
    }
11  
    null;
12  
  });
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027346
Snippet name: getFocusOwningComboBox
Eternal ID of this version: #1027346/1
Text MD5: 4e05d44a31e8fcb2b3412c854f1180c1
Transpilation MD5: 9f9b3c06154df93fa8f0c9affd5c76d3
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-11 11:35:57
Source code size: 394 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 105 / 161
Referenced in: [show references]