Note that there are some explanatory texts on larger screens.

plurals
  1. POForce Horizontal Tab Text on Left Aligned JTabbedPane
    text
    copied!<p>I am trying to make a JTabbedPane in Java 7 on OSX that has tabs positioned to the left with their text horizontal (instead of vertical). However, with the code:</p> <pre><code>import javax.swing.*; import java.awt.Dimension; class Probs extends JDialog { JTabbedPane options = new JTabbedPane(); Probs(JFrame owner) { //main constructor super(owner, "User Preferences", true); //set the tabs to be left aligned options.setTabPlacement(JTabbedPane.LEFT); //construct the authorization panel JPanel authorization = new JPanel(); authorization.add(new JLabel("test")); options.addTab("test", authorization); add(options); setSize(new Dimension(300,300)); //should use pack here setResizable(false); setLocationRelativeTo(null); setVisible(true); } public static void main(String[] args) { JFrame test = new JFrame(); new Probs(test); test.dispose(); } } </code></pre> <p>I get a dialog box which looks like: <a href="https://i.imgur.com/xGcndG1.png" rel="nofollow noreferrer">this image</a> </p> <p><img src="https://i.imgur.com/xGcndG1.png" ></p> <p>I would like the tab text to be horizontal (the 'test' title on the tab be oriented horizontally instead of vertically). </p> <p>I searched around on Google for a while and have only run into occurrences wherein people wanted to achieve vertical text on their tabs, I could not manage to locate any in which people wanted to have horizontal text (what I am trying to achieve).</p> <p>In particular, I am trying to achieve something which exactly looks like the image mentioned in the first post of <a href="https://stackoverflow.com/questions/8970930/vertical-orientation-of-jtabbedpane-titles-when-the-the-tab-placement-is-set-to">this</a> question. It is basically the exact opposite of that question because the person in that tab started with what I am trying to achieve (I believe). Basically, I am trying to determine how to create the image displayed in the first post of that question.</p> <p>Can someone please tell me how to have left-oriented tabs while preserving horizontal tab titles (as opposed to vertical)?</p> <p>Thank you for your time and assistance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload