tabs.setUI(new BasicTabbedPaneUI());
private void buildUI() { setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.insets = new Insets(DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); gbc.weighty = 0.01; addTab("Windows Bundle", createTab(OSFamily.windows)); addTab("Linux Bundle", createTab(OSFamily.linux)); addTab("MacOSX Bundle", createTab(OSFamily.macosx)); GridBagUtils.addToPanel(this, this.bundleTabPane, gbc, "gridx=0, gridy=0, gridwidth=11, weightx=1"); GridBagUtils.addToPanel(this, new JLabel("Reflect in Variable:"), gbc, "gridx=0, gridy=1, gridwidth=1, weightx=0"); variablesCombo = getEditorComponent(OSFamily.all, "updateVariable", this.variables.stream().map(SystemVariable::getKey).toArray()); GridBagUtils.addToPanel(this, variablesCombo, gbc, "gridx=1, gridy=1, gridwidth=10, weightx=0"); GridBagUtils.addToPanel(this, new JLabel(" "), gbc, "gridx=0, gridy=2, gridwidth=11, weighty=1"); int selected = 0; switch (Bundle.getCurrentOS()) { case windows: selected = 0; break; case linux: selected = 1; break; case macosx: selected = 2; break; } this.bundleTabPane.setSelectedIndex(selected); this.bundleTabPane.setUI(new BasicTabbedPaneUI()); }
@Override protected JTabbedPane createMainPanel() { this.tabbedPane = new JTabbedPane(JTabbedPane.LEFT); this.tabbedPane.setBorder(BorderFactory.createEmptyBorder()); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); double widthRatio = 0.5; formWidth = Math.max((int) (screenSize.width * widthRatio), MIN_TABBED_WIDTH); double heightRatio = 0.5; int formHeight = Math.max((int) (screenSize.height * heightRatio), MIN_TABBED_HEIGHT); tabbedPane.setPreferredSize(new Dimension(formWidth, formHeight)); getJDialog().setMinimumSize(new Dimension(formWidth + 16, formHeight + 72)); addTab(tabbedPane, Bundle.CTL_Panel_OperatorDescriptor_Text(), createDescriptorTab()); currentIndex++; addTab(tabbedPane, Bundle.CTL_Panel_ConfigParams_Text(), createToolInfoPanel()); currentIndex++; addTab(tabbedPane, Bundle.CTL_Panel_PreProcessing_Border_TitleText(), createPreProcessingTab()); currentIndex++; addTab(tabbedPane, Bundle.CTL_Panel_OpParams_Border_TitleText(), createParametersTab(formWidth)); currentIndex++; addTab(tabbedPane, Bundle.CTL_Panel_SysVar_Border_TitleText(), createVariablesPanel()); currentIndex++; addTab(tabbedPane, Bundle.CTL_Panel_Bundle_TitleText(), createBundlePanel()); currentIndex++; tabbedPane.setUI(new BasicTabbedPaneUI()); formWidth = tabbedPane.getTabComponentAt(0).getWidth(); return tabbedPane; }