JavaFX - How to make ComboBox hgrow?












9

















I have a problem with JavaFX(8), HBox, ComboBox and HGrow.
HGrow does not work in combination with ComboBox.


(INFO: with TextField (instead of ComboBox), it works as expected!)



This is my FXML-Code:



<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<VBox prefHeight="117.0" prefWidth="285.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.test.TestController">
<children>
<HBox prefHeight="105.0" prefWidth="196.0" VBox.vgrow="ALWAYS">
<children>
<ComboBox fx:id="fxCboTest" prefHeight="25.0" prefWidth="62.0" HBox.hgrow="ALWAYS" />
</children>
</HBox>
</children>
</VBox>


this Code will result in:



enter image description here



i also tried following code (without success, this code does nothing):



HBox.setHgrow(uiController.fxCboTest, Priority.ALWAYS);


Does anyone has an idea how to make an ComboBox HGrow?










share|improve this question



























    9

















    I have a problem with JavaFX(8), HBox, ComboBox and HGrow.
    HGrow does not work in combination with ComboBox.


    (INFO: with TextField (instead of ComboBox), it works as expected!)



    This is my FXML-Code:



    <?xml version="1.0" encoding="UTF-8"?>

    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>

    <VBox prefHeight="117.0" prefWidth="285.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.test.TestController">
    <children>
    <HBox prefHeight="105.0" prefWidth="196.0" VBox.vgrow="ALWAYS">
    <children>
    <ComboBox fx:id="fxCboTest" prefHeight="25.0" prefWidth="62.0" HBox.hgrow="ALWAYS" />
    </children>
    </HBox>
    </children>
    </VBox>


    this Code will result in:



    enter image description here



    i also tried following code (without success, this code does nothing):



    HBox.setHgrow(uiController.fxCboTest, Priority.ALWAYS);


    Does anyone has an idea how to make an ComboBox HGrow?










    share|improve this question

























      9












      9








      9


      1








      I have a problem with JavaFX(8), HBox, ComboBox and HGrow.
      HGrow does not work in combination with ComboBox.


      (INFO: with TextField (instead of ComboBox), it works as expected!)



      This is my FXML-Code:



      <?xml version="1.0" encoding="UTF-8"?>

      <?import java.lang.*?>
      <?import java.util.*?>
      <?import javafx.scene.*?>
      <?import javafx.scene.control.*?>
      <?import javafx.scene.layout.*?>

      <VBox prefHeight="117.0" prefWidth="285.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.test.TestController">
      <children>
      <HBox prefHeight="105.0" prefWidth="196.0" VBox.vgrow="ALWAYS">
      <children>
      <ComboBox fx:id="fxCboTest" prefHeight="25.0" prefWidth="62.0" HBox.hgrow="ALWAYS" />
      </children>
      </HBox>
      </children>
      </VBox>


      this Code will result in:



      enter image description here



      i also tried following code (without success, this code does nothing):



      HBox.setHgrow(uiController.fxCboTest, Priority.ALWAYS);


      Does anyone has an idea how to make an ComboBox HGrow?










      share|improve this question
















      I have a problem with JavaFX(8), HBox, ComboBox and HGrow.
      HGrow does not work in combination with ComboBox.


      (INFO: with TextField (instead of ComboBox), it works as expected!)



      This is my FXML-Code:



      <?xml version="1.0" encoding="UTF-8"?>

      <?import java.lang.*?>
      <?import java.util.*?>
      <?import javafx.scene.*?>
      <?import javafx.scene.control.*?>
      <?import javafx.scene.layout.*?>

      <VBox prefHeight="117.0" prefWidth="285.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.test.TestController">
      <children>
      <HBox prefHeight="105.0" prefWidth="196.0" VBox.vgrow="ALWAYS">
      <children>
      <ComboBox fx:id="fxCboTest" prefHeight="25.0" prefWidth="62.0" HBox.hgrow="ALWAYS" />
      </children>
      </HBox>
      </children>
      </VBox>


      this Code will result in:



      enter image description here



      i also tried following code (without success, this code does nothing):



      HBox.setHgrow(uiController.fxCboTest, Priority.ALWAYS);


      Does anyone has an idea how to make an ComboBox HGrow?







      combobox javafx javafx-8






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 7 '15 at 10:55









      BenBen

      2,2971438




      2,2971438
























          3 Answers
          3






          active

          oldest

          votes


















          21














          This is an answer to my own question.

          After some testing, I found out that when setting Max Width to MAX_VALUE, it works:



          enter image description here



          This will result in following code/xml from SceneBuilder:



          ...
          <children>
          <ComboBox maxWidth="1.7976931348623157E308" prefWidth="150.0" HBox.hgrow="ALWAYS" />
          </children>
          ...


          where 1.7976931348623157E308 looks like Double.MAX_VALUE.


          This will also work with multiple controls in Hbox.
          enter image description here



          In my opinion, this is not very consequently/consistently.

          I still don't unserstand why HGrow does not work for ComboBox.






          share|improve this answer


























          • hgrow will not override a resizable node's maximum width, which is set to the preferred size by default. There's a little information on this in the tutorial and also an excellent presentation at Parleys (registration required).

            – James_D
            Apr 7 '15 at 13:00






          • 1





            So, why does it work when just replacing ComboBox with TextField in XML?

            – Ben
            Apr 7 '15 at 13:07






          • 4





            Dug a little further into the default settings. The maxWidth defaults for both to the sentinel value Region.COMPUTED_SIZE, which causes a call to computeMaxWidth(...). For controls, this in turn delegates to the skin implementation. Digging into the source code, ComboBoxBaseSkin resolves this by returning the preferred width; the TextFieldSkin just inherits the default SkinBase implementation, which returns Double.MAX_VALUE. Hence a combo box by default is limited to its preferred size; a text field is allowed to grow indefinitely. The bottom line is they have different defaults.

            – James_D
            Apr 8 '15 at 2:15





















          1














          This is a hack, but it should work. Inside the controller's intialize method, define a binding.



          @Override
          public void initialize(URL location, ResourceBundle resources) {
          fxCboTest.prefWidthProperty().bind(hbox.widthProperty());
          }





          share|improve this answer
























          • Thanks for your suggestion, but this code may not work properly when (not in my code example, cause i want keep my example as simple as possible) the hbox contains multiple controls, like ComboBox and Button. i want to avoid too much calculating by myself.

            – Ben
            Apr 7 '15 at 11:45













          • The question never mentioned that you wanted multiple children in the HBox.

            – ItachiUchiha
            Apr 7 '15 at 12:47











          • You are right, this is why i add an comment to your answer why your solution may not work with multiple controls. i didn't said that your solution is absolute unhelpful.

            – Ben
            Apr 7 '15 at 13:01



















          1














          I had the same problem, but I'm not using Scene Builder.

          So my fix, based on Ben's answer, is in the code below:



          ComboBox comboBox = new ComboBox(...);
          ...
          comboBox.setMaxWidth(Double.MAX_VALUE);





          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29489880%2fjavafx-how-to-make-combobox-hgrow%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            21














            This is an answer to my own question.

            After some testing, I found out that when setting Max Width to MAX_VALUE, it works:



            enter image description here



            This will result in following code/xml from SceneBuilder:



            ...
            <children>
            <ComboBox maxWidth="1.7976931348623157E308" prefWidth="150.0" HBox.hgrow="ALWAYS" />
            </children>
            ...


            where 1.7976931348623157E308 looks like Double.MAX_VALUE.


            This will also work with multiple controls in Hbox.
            enter image description here



            In my opinion, this is not very consequently/consistently.

            I still don't unserstand why HGrow does not work for ComboBox.






            share|improve this answer


























            • hgrow will not override a resizable node's maximum width, which is set to the preferred size by default. There's a little information on this in the tutorial and also an excellent presentation at Parleys (registration required).

              – James_D
              Apr 7 '15 at 13:00






            • 1





              So, why does it work when just replacing ComboBox with TextField in XML?

              – Ben
              Apr 7 '15 at 13:07






            • 4





              Dug a little further into the default settings. The maxWidth defaults for both to the sentinel value Region.COMPUTED_SIZE, which causes a call to computeMaxWidth(...). For controls, this in turn delegates to the skin implementation. Digging into the source code, ComboBoxBaseSkin resolves this by returning the preferred width; the TextFieldSkin just inherits the default SkinBase implementation, which returns Double.MAX_VALUE. Hence a combo box by default is limited to its preferred size; a text field is allowed to grow indefinitely. The bottom line is they have different defaults.

              – James_D
              Apr 8 '15 at 2:15


















            21














            This is an answer to my own question.

            After some testing, I found out that when setting Max Width to MAX_VALUE, it works:



            enter image description here



            This will result in following code/xml from SceneBuilder:



            ...
            <children>
            <ComboBox maxWidth="1.7976931348623157E308" prefWidth="150.0" HBox.hgrow="ALWAYS" />
            </children>
            ...


            where 1.7976931348623157E308 looks like Double.MAX_VALUE.


            This will also work with multiple controls in Hbox.
            enter image description here



            In my opinion, this is not very consequently/consistently.

            I still don't unserstand why HGrow does not work for ComboBox.






            share|improve this answer


























            • hgrow will not override a resizable node's maximum width, which is set to the preferred size by default. There's a little information on this in the tutorial and also an excellent presentation at Parleys (registration required).

              – James_D
              Apr 7 '15 at 13:00






            • 1





              So, why does it work when just replacing ComboBox with TextField in XML?

              – Ben
              Apr 7 '15 at 13:07






            • 4





              Dug a little further into the default settings. The maxWidth defaults for both to the sentinel value Region.COMPUTED_SIZE, which causes a call to computeMaxWidth(...). For controls, this in turn delegates to the skin implementation. Digging into the source code, ComboBoxBaseSkin resolves this by returning the preferred width; the TextFieldSkin just inherits the default SkinBase implementation, which returns Double.MAX_VALUE. Hence a combo box by default is limited to its preferred size; a text field is allowed to grow indefinitely. The bottom line is they have different defaults.

              – James_D
              Apr 8 '15 at 2:15
















            21












            21








            21







            This is an answer to my own question.

            After some testing, I found out that when setting Max Width to MAX_VALUE, it works:



            enter image description here



            This will result in following code/xml from SceneBuilder:



            ...
            <children>
            <ComboBox maxWidth="1.7976931348623157E308" prefWidth="150.0" HBox.hgrow="ALWAYS" />
            </children>
            ...


            where 1.7976931348623157E308 looks like Double.MAX_VALUE.


            This will also work with multiple controls in Hbox.
            enter image description here



            In my opinion, this is not very consequently/consistently.

            I still don't unserstand why HGrow does not work for ComboBox.






            share|improve this answer















            This is an answer to my own question.

            After some testing, I found out that when setting Max Width to MAX_VALUE, it works:



            enter image description here



            This will result in following code/xml from SceneBuilder:



            ...
            <children>
            <ComboBox maxWidth="1.7976931348623157E308" prefWidth="150.0" HBox.hgrow="ALWAYS" />
            </children>
            ...


            where 1.7976931348623157E308 looks like Double.MAX_VALUE.


            This will also work with multiple controls in Hbox.
            enter image description here



            In my opinion, this is not very consequently/consistently.

            I still don't unserstand why HGrow does not work for ComboBox.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 2 '16 at 10:44

























            answered Apr 7 '15 at 12:04









            BenBen

            2,2971438




            2,2971438













            • hgrow will not override a resizable node's maximum width, which is set to the preferred size by default. There's a little information on this in the tutorial and also an excellent presentation at Parleys (registration required).

              – James_D
              Apr 7 '15 at 13:00






            • 1





              So, why does it work when just replacing ComboBox with TextField in XML?

              – Ben
              Apr 7 '15 at 13:07






            • 4





              Dug a little further into the default settings. The maxWidth defaults for both to the sentinel value Region.COMPUTED_SIZE, which causes a call to computeMaxWidth(...). For controls, this in turn delegates to the skin implementation. Digging into the source code, ComboBoxBaseSkin resolves this by returning the preferred width; the TextFieldSkin just inherits the default SkinBase implementation, which returns Double.MAX_VALUE. Hence a combo box by default is limited to its preferred size; a text field is allowed to grow indefinitely. The bottom line is they have different defaults.

              – James_D
              Apr 8 '15 at 2:15





















            • hgrow will not override a resizable node's maximum width, which is set to the preferred size by default. There's a little information on this in the tutorial and also an excellent presentation at Parleys (registration required).

              – James_D
              Apr 7 '15 at 13:00






            • 1





              So, why does it work when just replacing ComboBox with TextField in XML?

              – Ben
              Apr 7 '15 at 13:07






            • 4





              Dug a little further into the default settings. The maxWidth defaults for both to the sentinel value Region.COMPUTED_SIZE, which causes a call to computeMaxWidth(...). For controls, this in turn delegates to the skin implementation. Digging into the source code, ComboBoxBaseSkin resolves this by returning the preferred width; the TextFieldSkin just inherits the default SkinBase implementation, which returns Double.MAX_VALUE. Hence a combo box by default is limited to its preferred size; a text field is allowed to grow indefinitely. The bottom line is they have different defaults.

              – James_D
              Apr 8 '15 at 2:15



















            hgrow will not override a resizable node's maximum width, which is set to the preferred size by default. There's a little information on this in the tutorial and also an excellent presentation at Parleys (registration required).

            – James_D
            Apr 7 '15 at 13:00





            hgrow will not override a resizable node's maximum width, which is set to the preferred size by default. There's a little information on this in the tutorial and also an excellent presentation at Parleys (registration required).

            – James_D
            Apr 7 '15 at 13:00




            1




            1





            So, why does it work when just replacing ComboBox with TextField in XML?

            – Ben
            Apr 7 '15 at 13:07





            So, why does it work when just replacing ComboBox with TextField in XML?

            – Ben
            Apr 7 '15 at 13:07




            4




            4





            Dug a little further into the default settings. The maxWidth defaults for both to the sentinel value Region.COMPUTED_SIZE, which causes a call to computeMaxWidth(...). For controls, this in turn delegates to the skin implementation. Digging into the source code, ComboBoxBaseSkin resolves this by returning the preferred width; the TextFieldSkin just inherits the default SkinBase implementation, which returns Double.MAX_VALUE. Hence a combo box by default is limited to its preferred size; a text field is allowed to grow indefinitely. The bottom line is they have different defaults.

            – James_D
            Apr 8 '15 at 2:15







            Dug a little further into the default settings. The maxWidth defaults for both to the sentinel value Region.COMPUTED_SIZE, which causes a call to computeMaxWidth(...). For controls, this in turn delegates to the skin implementation. Digging into the source code, ComboBoxBaseSkin resolves this by returning the preferred width; the TextFieldSkin just inherits the default SkinBase implementation, which returns Double.MAX_VALUE. Hence a combo box by default is limited to its preferred size; a text field is allowed to grow indefinitely. The bottom line is they have different defaults.

            – James_D
            Apr 8 '15 at 2:15















            1














            This is a hack, but it should work. Inside the controller's intialize method, define a binding.



            @Override
            public void initialize(URL location, ResourceBundle resources) {
            fxCboTest.prefWidthProperty().bind(hbox.widthProperty());
            }





            share|improve this answer
























            • Thanks for your suggestion, but this code may not work properly when (not in my code example, cause i want keep my example as simple as possible) the hbox contains multiple controls, like ComboBox and Button. i want to avoid too much calculating by myself.

              – Ben
              Apr 7 '15 at 11:45













            • The question never mentioned that you wanted multiple children in the HBox.

              – ItachiUchiha
              Apr 7 '15 at 12:47











            • You are right, this is why i add an comment to your answer why your solution may not work with multiple controls. i didn't said that your solution is absolute unhelpful.

              – Ben
              Apr 7 '15 at 13:01
















            1














            This is a hack, but it should work. Inside the controller's intialize method, define a binding.



            @Override
            public void initialize(URL location, ResourceBundle resources) {
            fxCboTest.prefWidthProperty().bind(hbox.widthProperty());
            }





            share|improve this answer
























            • Thanks for your suggestion, but this code may not work properly when (not in my code example, cause i want keep my example as simple as possible) the hbox contains multiple controls, like ComboBox and Button. i want to avoid too much calculating by myself.

              – Ben
              Apr 7 '15 at 11:45













            • The question never mentioned that you wanted multiple children in the HBox.

              – ItachiUchiha
              Apr 7 '15 at 12:47











            • You are right, this is why i add an comment to your answer why your solution may not work with multiple controls. i didn't said that your solution is absolute unhelpful.

              – Ben
              Apr 7 '15 at 13:01














            1












            1








            1







            This is a hack, but it should work. Inside the controller's intialize method, define a binding.



            @Override
            public void initialize(URL location, ResourceBundle resources) {
            fxCboTest.prefWidthProperty().bind(hbox.widthProperty());
            }





            share|improve this answer













            This is a hack, but it should work. Inside the controller's intialize method, define a binding.



            @Override
            public void initialize(URL location, ResourceBundle resources) {
            fxCboTest.prefWidthProperty().bind(hbox.widthProperty());
            }






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 7 '15 at 11:15









            ItachiUchihaItachiUchiha

            27.6k677136




            27.6k677136













            • Thanks for your suggestion, but this code may not work properly when (not in my code example, cause i want keep my example as simple as possible) the hbox contains multiple controls, like ComboBox and Button. i want to avoid too much calculating by myself.

              – Ben
              Apr 7 '15 at 11:45













            • The question never mentioned that you wanted multiple children in the HBox.

              – ItachiUchiha
              Apr 7 '15 at 12:47











            • You are right, this is why i add an comment to your answer why your solution may not work with multiple controls. i didn't said that your solution is absolute unhelpful.

              – Ben
              Apr 7 '15 at 13:01



















            • Thanks for your suggestion, but this code may not work properly when (not in my code example, cause i want keep my example as simple as possible) the hbox contains multiple controls, like ComboBox and Button. i want to avoid too much calculating by myself.

              – Ben
              Apr 7 '15 at 11:45













            • The question never mentioned that you wanted multiple children in the HBox.

              – ItachiUchiha
              Apr 7 '15 at 12:47











            • You are right, this is why i add an comment to your answer why your solution may not work with multiple controls. i didn't said that your solution is absolute unhelpful.

              – Ben
              Apr 7 '15 at 13:01

















            Thanks for your suggestion, but this code may not work properly when (not in my code example, cause i want keep my example as simple as possible) the hbox contains multiple controls, like ComboBox and Button. i want to avoid too much calculating by myself.

            – Ben
            Apr 7 '15 at 11:45







            Thanks for your suggestion, but this code may not work properly when (not in my code example, cause i want keep my example as simple as possible) the hbox contains multiple controls, like ComboBox and Button. i want to avoid too much calculating by myself.

            – Ben
            Apr 7 '15 at 11:45















            The question never mentioned that you wanted multiple children in the HBox.

            – ItachiUchiha
            Apr 7 '15 at 12:47





            The question never mentioned that you wanted multiple children in the HBox.

            – ItachiUchiha
            Apr 7 '15 at 12:47













            You are right, this is why i add an comment to your answer why your solution may not work with multiple controls. i didn't said that your solution is absolute unhelpful.

            – Ben
            Apr 7 '15 at 13:01





            You are right, this is why i add an comment to your answer why your solution may not work with multiple controls. i didn't said that your solution is absolute unhelpful.

            – Ben
            Apr 7 '15 at 13:01











            1














            I had the same problem, but I'm not using Scene Builder.

            So my fix, based on Ben's answer, is in the code below:



            ComboBox comboBox = new ComboBox(...);
            ...
            comboBox.setMaxWidth(Double.MAX_VALUE);





            share|improve this answer






























              1














              I had the same problem, but I'm not using Scene Builder.

              So my fix, based on Ben's answer, is in the code below:



              ComboBox comboBox = new ComboBox(...);
              ...
              comboBox.setMaxWidth(Double.MAX_VALUE);





              share|improve this answer




























                1












                1








                1







                I had the same problem, but I'm not using Scene Builder.

                So my fix, based on Ben's answer, is in the code below:



                ComboBox comboBox = new ComboBox(...);
                ...
                comboBox.setMaxWidth(Double.MAX_VALUE);





                share|improve this answer















                I had the same problem, but I'm not using Scene Builder.

                So my fix, based on Ben's answer, is in the code below:



                ComboBox comboBox = new ComboBox(...);
                ...
                comboBox.setMaxWidth(Double.MAX_VALUE);






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 27 '18 at 1:58









                סטנלי גרונן

                1,75682244




                1,75682244










                answered Nov 26 '18 at 20:29









                pinkston00pinkston00

                737




                737






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29489880%2fjavafx-how-to-make-combobox-hgrow%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Contact image not getting when fetch all contact list from iPhone by CNContact

                    count number of partitions of a set with n elements into k subsets

                    A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks