void (int policy) { boolean singleRow = switch (policy) { case JTabbedPane.SCROLL_TAB_LAYOUT -> true; case JTabbedPane.WRAP_TAB_LAYOUT -> false; default -> throw new IllegalArgumentException("Unsupported tab layout policy: " + policy); }; myTabs.getPresentation().setSingleRow(singleRow); }