Example usage for javax.swing JTabbedPane setComponentOrientation

List of usage examples for javax.swing JTabbedPane setComponentOrientation

Introduction

In this page you can find the example usage for javax.swing JTabbedPane setComponentOrientation.

Prototype

public void setComponentOrientation(ComponentOrientation o) 

Source Link

Document

Sets the language-sensitive orientation that is to be used to order the elements or text within this component.

Usage

From source file:net.pms.newgui.LooksFrame.java

public JComponent buildMain() {
    final JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP);

    tabbedPane.setUI(new CustomTabbedPaneUI());

    st = new StatusTab(configuration);
    tt = new TracesTab(configuration, this);
    gt = new GeneralTab(configuration, this);
    nt = new NavigationShareTab(configuration, this);
    tr = new TranscodingTab(configuration, this);
    ht = new HelpTab();

    tabbedPane.addTab(Messages.getString("LooksFrame.18"), st.build());
    tabbedPane.addTab(Messages.getString("LooksFrame.19"), tt.build());
    tabbedPane.addTab(Messages.getString("LooksFrame.20"), gt.build());
    tabbedPane.addTab(Messages.getString("LooksFrame.22"), nt.build());
    if (!configuration.isDisableTranscoding()) {
        tabbedPane.addTab(Messages.getString("LooksFrame.21"), tr.build());
    } else {/*from   w ww. jav  a2 s. c o m*/
        tr.build();
    }
    tabbedPane.addTab(Messages.getString("LooksFrame.24"), new HelpTab().build());
    tabbedPane.addTab(Messages.getString("LooksFrame.25"), new AboutTab().build());

    tabbedPane.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            int selectedIndex = tabbedPane.getSelectedIndex();

            if (HELP_PAGES[selectedIndex] != null) {
                PMS.setHelpPage(HELP_PAGES[selectedIndex]);

                // Update the contents of the help tab itself
                ht.updateContents();
            }
        }
    });

    tabbedPane.setBorder(new EmptyBorder(5, 5, 5, 5));

    /*
     * Set the orientation of the tabbedPane.
     * Note: Do not use applyComponentOrientation() here because it
     * messes with the layout of several tabs.
     */
    ComponentOrientation orientation = ComponentOrientation.getOrientation(PMS.getLocale());
    tabbedPane.setComponentOrientation(orientation);

    return tabbedPane;
}