#navi(contents-page-name): No such page: ST

FrontPage>Swing Tips>ST/TabbedPane

ST/TabbedPane

Terai Atsuhiro 2024-01-27 (土) 14:37:42

JTabbedPane

#ref(): File not found: "TabbedPane.png" at page "Swing/TabbedPane"

private void showTabPop(MouseEvent e){
  JPopupMenu pop = new JPopupMenu();
  AbstractAction action = new NewTabAction(MENUITEM_NEWTAB, null);
  pop.add(action);
  pop.addSeparator();
  action = new ClosePageAction(MENUITEM_CLOSEPAGE, null);
  boolean flg = false;
  for(int i=0;i<tab.getTabCount();i++){
    if(tab.getBoundsAt(i).contains(e.getPoint())){
      flg = true;
      break;
    }
  }
  action.setEnabled(flg);
  pop.add(action);
  pop.addSeparator();
  action = new CloseAllAction(MENUITEM_CLOSEALL, null);
  pop.add(action);
  action = new CloseAllButActiveAction(MENUITEM_CLOSEALLBUTACTIVE, null);
  pop.add(action);
  pop.show(tab, e.getX(), e.getY());
}