Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML to fire JTabbedPane switch tab
    primarykey
    data
    text
    <p>Right now the goal I would like to acheieve is to have the HTML links(which each have a tab dedicated to them) fire the setSelectedComponent JTabbedPane function. In other words rather than jump down to the section on the "All" tab(which is what the html version of the page does) I want it to switch tabs. Please note, if this is not possible, is it possible to have them jump down to the sections like it does in a browser(because this isn't working natively either)?</p> <pre><code>&lt;nav&gt; [ &lt;a href="gameplayhelp.php#Basic"&gt;Basic&lt;/a&gt; | &lt;a href="gameplayhelp.php#Maps"&gt;Maps&lt;/a&gt; | &lt;a href="gameplayhelp.php#Quests"&gt;Quests&lt;/a&gt; | &lt;a href="gameplayhelp.php#NPCs"&gt;NPCs&lt;/a&gt; | &lt;a href="gameplayhelp.php#Monsters"&gt;Monsters&lt;/a&gt; | &lt;a href="gameplayhelp.php#Items"&gt;Items&lt;/a&gt; | &lt;a href="gameplayhelp.php#Marketplace"&gt;Marketplace&lt;/a&gt; | &lt;a href="gameplayhelp.php#Skills"&gt;Skills&lt;/a&gt; | &lt;a href="gameplayhelp.php#Storage"&gt;Storage&lt;/a&gt; ] &lt;/nav&gt; </code></pre> <p><img src="https://i.stack.imgur.com/g5KmH.png" alt="enter image description here"></p> <p>Here is the relevant code that creates this image. The large section of code above this parses my website and seperates the HTML into only the body of the page (varaible: htmlContent) and each help section (variable: helpSection).</p> <pre><code>JScrollPane scrollPane = new JScrollPane(); JEditorPane editorPane = new JEditorPane(); scrollPane.setViewportView(editorPane); editorPane.setEditorKit(kit); editorPane.setEditable(false); editorPane.setContentType("text/html"); editorPane.setText(htmlContent); editorPane.setCaretPosition(0); tabbedPane.addTab("All", null, scrollPane, "All gameplay help"); for(String s: navLinks){ tabbedPane.addTab(s, null, new JScrollPane(new JEditorPane("text/html", helpSection.get(0))), s + " gameplay help"); helpSection.remove(0); } </code></pre> <p>In case anyone wants to take a look at the html I'm parsing it is:</p> <p><a href="http://www.kisnardonline.com/gameplayhelp.php" rel="nofollow noreferrer">http://www.kisnardonline.com/gameplayhelp.php</a></p> <p>Thanks in advance for any help with this! :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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