How can I display a  tree structure?

I would like to display a tree stucture, but don't want to use the JTree look. I would like the tree to look something like the following (but with boxes around the names, and arrows point from children to parent):
            --- child1
root ---|
                                --- child3
            --- child2 --|
                                --- child4Is there a class already out there I can implement and use for this? Or do I basically have to start from scratch?

It strikes me that JTree should have a setHorizontalLayout() feature... But scratch never was a bad place to start, was it?

Similar Messages

  • How can I create a Tree  Structure in java ??

    Hi,
    I want to create a tree structure(objects hierarchy) using java language. Is there any API method for this ?
    Can any one please give me a hint or suggestion how I can do this ??
    Thanks for the help in advance.

    Do you mean graphically?
    You can use a TreeSet or TreeMap if you just want to use tree structures.
    Kaj

  • How can i call a tree from a subvi?

    I have a subvi which build a tree and give as an output a reference to it.
    how can i display that tree on the front panel of a main vi. for instance press a button on the main front panel esecutes the subvi and display the tree on the main front panel.
    thank you
    diego

    Hi
    Put tree control on front pane of main.vil, create his (of control) reference and send it to your subVI
    Eugene 

  • How can I display  contacts in a relationship

    I have companies in my CRM. I have a customers/contacts in the CRM I have tied as a relationship with each companies. How can I display all the records/contacts associated with a company? I have a already created a secure zone, so the company user would have logged in. Is this possible? If not, any workaround?
    The only workaround I thought of is to use webapp to import the company data and create another web app containing the employees data. Then link both tables/webapp using datasource. But the way the client's data is structured could create a lot of problems going forward.
    Any suggestion, help will be appreciated

    The relationship feature and how companies work currently in BC is really limited. It is an association and not true relationships at the moment. You cant output a company and show all its relationships at the moment.

  • How can I display all of my bookmarks along the left side of my browser window like earlier versions of Firefox?

    I like the bookmarks on the left side of the screen. I don't want to be navigating through a tree of all of my various bookmarks. How can I display all of my bookmarks along the left side of my browser window like earlier versions of Firefox?

    View > Sidebar > Bookmarks (Ctrl+B)
    Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily if the Menu Bar is hidden.
    *https://support.mozilla.com/kb/how-do-i-use-bookmarks

  • How can I write a tree report?

    How can I write a tree report? If you have any document/ link can you please send that.
    Regards,
    Subhasish

    REPORT  zdemo_alv_tree.
    Demo program prepared for ****************
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    DATA tree1  TYPE REF TO cl_gui_alv_tree_simple.
    INCLUDE <icon>.
    INCLUDE bcalv_simple_event_receiver.
    DATA: gt_sflight      TYPE sflight OCCURS 0,   " Output-Table
          gt_fieldcatalog TYPE lvc_t_fcat,         " Field Catalog
          gt_sort         TYPE lvc_t_sort,         " Sorting Table
          ok_code         LIKE sy-ucomm.           " OK-Code
    END-OF-SELECTION.
      CALL SCREEN 100.
    *&      Form  BUILD_FIELDCATALOG
    This subroutine is used to build the field catalog for the ALV list
    FORM build_fieldcatalog.
    get fieldcatalog
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SFLIGHT'
        CHANGING
          ct_fieldcat      = gt_fieldcatalog.
    change fieldcatalog
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
        CASE ls_fieldcatalog-fieldname.
          WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
            ls_fieldcatalog-no_out = 'X'.
            ls_fieldcatalog-key    = ''.
          WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
            ls_fieldcatalog-do_sum = 'X'.
        ENDCASE.
        MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
      ENDLOOP.
    ENDFORM.                               " BUILD_FIELDCATALOG
    *&      Form  BUILD_OUTTAB
    Retrieving the data from the table and filling it in the output table
    of the ALV list
    FORM build_outtab.
      SELECT * FROM sflight INTO TABLE gt_sflight.
    ENDFORM.                               " BUILD_OUTTAB
    *&      Form  BUILD_SORT_TABLE
    This subroutine is used to build the sort table or the sort criteria
    FORM build_sort_table.
      DATA ls_sort_wa TYPE lvc_s_sort.
    create sort-table
      ls_sort_wa-spos = 1.
      ls_sort_wa-fieldname = 'CARRID'.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
      ls_sort_wa-spos = 2.
      ls_sort_wa-fieldname = 'CONNID'.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
      ls_sort_wa-spos = 3.
      ls_sort_wa-fieldname = 'FLDATE'.
      ls_sort_wa-up = 'X'.
      APPEND ls_sort_wa TO gt_sort.
    ENDFORM.                               " BUILD_SORT_TABLE
    *&      Module  PBO  OUTPUT
    This subroutine is used to build the ALV Tree
    MODULE pbo OUTPUT.
      IF tree1 IS INITIAL.
        PERFORM init_tree.
      ENDIF.
      SET PF-STATUS 'ZSTATUS'.
    ENDMODULE.                             " PBO  OUTPUT
    *&      Module  PAI  INPUT
    This subroutine is used to handle the navigation on the screen
    MODULE pai INPUT.
      CASE ok_code.
        WHEN 'EXIT' OR 'BACK' OR 'CANC'.
          PERFORM exit_program.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                             " PAI  INPUT
    *&      Form  exit_program
          free object and leave program
    FORM exit_program.
      CALL METHOD tree1->free.
      LEAVE PROGRAM.
    ENDFORM.                               " exit_program
    *&      Form  register_events
    Handling the events in the ALV Tree control in backend
    FORM register_events.
    define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      APPEND l_event TO lt_events.
      CALL METHOD tree1->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    set Handler
      DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->on_add_hierarchy_node
                                                            FOR tree1.
    ENDFORM.                               " register_events
    *&      Form  build_header
          build table for header
    FORM build_comment USING
          pt_list_commentary TYPE slis_t_listheader
          p_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader.
    LIST HEADING LINE: TYPE H
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'ALV TREE DEMO for ****************'.
      APPEND ls_line TO pt_list_commentary.
      p_logo = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "build_comment
    *&      Form  init_tree
    Building the ALV-Tree for the first time display
    FORM init_tree.
      PERFORM build_fieldcatalog.
      PERFORM build_outtab.
      PERFORM build_sort_table.
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      CREATE OBJECT l_custom_container
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
    create tree control
      CREATE OBJECT tree1
        EXPORTING
            i_parent              = l_custom_container
            i_node_selection_mode =
                                  cl_gui_column_tree=>node_sel_mode_multiple
            i_item_selection      = 'X'
            i_no_html_header      = ''
            i_no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
    create info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader,
            l_logo             TYPE sdydo_value.
      PERFORM build_comment USING
                     lt_list_commentary
                     l_logo.
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    register events
      PERFORM register_events.
    create hierarchy
      CALL METHOD tree1->set_table_for_first_display
        EXPORTING
          it_list_commentary = lt_list_commentary
          i_logo             = l_logo
          i_background_id    = 'ALV_BACKGROUND'
          i_save             = 'A'
          is_variant         = ls_variant
        CHANGING
          it_sort            = gt_sort
          it_outtab          = gt_sflight
          it_fieldcatalog    = gt_fieldcatalog.
    expand first level
      CALL METHOD tree1->expand_tree
        EXPORTING
          i_level = 1.
    optimize column-width
      CALL METHOD tree1->column_optimize
        EXPORTING
          i_start_column = tree1->c_hierarchy_column_name
          i_end_column   = tree1->c_hierarchy_column_name.
    ENDFORM.                    " init_tree

  • How can I display XSLT transformer errors on a web page ?

    Hi,
    I have some JSP pages that access DB, create an XML based on DB data and then transform it into HTML through an XSLT stylesheet. Developing the XSL code it's easy to make mistakes and generate errors on trasformation, but what I receive on the web page is only a "Could not compile stylesheet" TransformerConfigurationException, while the real cause of the error is displayed only on tomcat logs. This is the code for transformation:
    static public void applyXSLT(Document docXML, InputStream isXSL, PrintWriter pw) throws TransformerException, Exception {
            // instantiate the TransformerFactory.
            TransformerFactory tFactory = TransformerFactory.newInstance();
            // creates an error listener
            XslErrorListener xel = new XslErrorListener();
            // sets the error listener for the factory
            tFactory.setErrorListener(xel);
            // generate the transformer
            Transformer transformer = tFactory.newTransformer(new SAXSource(new InputSource(isXSL)));
            // transforms the XML Source and sends the output to the HTTP response
            transformer.transform(new DOMSource(docXML), new StreamResult(pw));
    }If an exception is thrown during the execution of this code, its error message is displayed on the web page.
    This is the listener class:
    public class XslErrorListener implements ErrorListener {
        public XslErrorListener() {
        public void warning(TransformerException ex) {
            // logs on error log
            System.err.println("\n\nWarning on XEL: " + ex.getMessage());
        public void error(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nError on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
        public void fatalError(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nFatal Error on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
    }When I have an error in the XSL stylesheet (for examples a missing closing tag), I can find on tomcat logs the real cause of the error:
    [Fatal Error] :59:10: The element type "table" must be terminated by the matching end-tag "</table>".
    Error on XEL: The element type "table" must be terminated by the matching end-tag "</table>".but on my web page is reported just the TransformerConfigurationException message that is:
    "Could not compile stylesheet".
    How can I display the real cause of the error directly on the web page?
    Thanks,
    Andrea

    This code is part of a bigger project that let developers edit XSL stylesheets through a file upload on the system and we can't impose the use of any tool for checking the xsl. So, I need to display the transformer error on the web page.I see. This code is part of an editorial/developmental tool for developers to create and edit XSL stylesheets.
    As part of the editorial process, XSL errors during editing can be considered a normal condition. In other words, it is normal to expect that the developers will generate XSL errors as they are developing stylesheets.
    In this light, handling the XSL transformation errors is a business requirement that you need to handle. Using the Java Exceptions mechanisms, e.g. try / catch are inappropriate to handle business requirements, in my opinion.
    I suggest that you look at how you handle the occurence of XSL errors differently than what you currently have. You need to:
    (1) capture the Transformation exception on the server;
    (2) extract the message from the exception and put it into a message that can be easily understood by the user;
    The current error message that you have going to the web browser is not useful.
    And you should not have the Transformation exception sent to the web browser either.
    What you are attempting to do with the exception is not appropriate.
    Handle the Transformation exception on the Business tier and use it to create a useful message that is then sent to the Presentation tier. In other words, do not send Java exceptions to web browser.
    />

  • How can I display True/False in my dropdownlist as "Yes" and "No"?

    Hi All,
    I want to bind a dropdownlist to a boolean value (so it's either true or false).  I'm particularly interested in using two-way binding to when the user changes from "yes" to "no" the boolean value automatically changes from "true" to "false."  But, I want the user to see "yes" and "no" as the options, rather than "true" and "false".
    How can I display "yes" and "no" and still take advantage of binding?  Or can I not use binding in this circumstance?
      -Josh

    Solution 1:
    In order to display Yes/No for True/False, you may specify labelFunction for the dropdownList.
    In MXML:
    <s:DropDownList labelFunction="myLabelFunction" />
    In actionscript:
    private var arr:ArrayCollection = new ArrayCollection(["true","false"]);
                private function mylabelFunction(item:Object):String
                    if(item.toString() == "true")
                        return "yes";
                    else return "No";
    OR
    Solution2:
    may be u can try making an array collection like
    private var arr:ArrayCollection = new ArrayCollection([{label:"yes",value:"true"},{label:"no",value:"false"}]);
    and specify labelField for the dropdownList like
    <s:DropDownList labelField="label" dataProvider="{arr}" />

  • How can I display & split the audio & video from the same digitized clip?

    I digitized a scene into iMovie that I edited on a professional system which I don't have access to anymore. The whole scene is 1 clip. Now I see a few tweaks that I want to make, so I was hoping to do them in iMovie.
    I want to "pull up" the audio in one section - meaning I want to take cut about 20 frames of audio from the end of a shot, and then move all the other audio up to fill the hole. To compensate for the missing 20 frames, I'll cut video off the head of the next shot. Some call this prelapping. Some call it an L-cut. Some call it asymmetrical trimming. Either way, I can't figure out how to do it in iMovie.
    My clip appears in the timeline as one track - a single track that contains the video and 2 audio tracks. How can I display the audio that's tied to the video on its own track? Then I think I could split audio & video wherever I wanted and trim things up - but I can't figure out how to do it.
    Am I asking too much of this software?
    BTW, I never see the option to "Split audio clip at playhead". I'm not displaying clip volume or waveforms. Choosing to display waveforms doesn't show me anything. Maybe iMovie thinks I'd only want to see waveforms of audio that isn't tied to my video-and-audio clips?
    Thanks in advance for any help...

    Jordon,
    "Am I asking too much of this software?"
    No, you're not.
    You first want to select your clip(s) and choose Advanced>Extract Audio.
    This will copy the audio from the video clip and place it on one of the two separate audio tracks while lowering the audio level to zero in the original video track.
    You can now edit and move the audio independently of the video.
    With the audio clip selected, you'll find you now have access to Edit>Split Selected Audio Clip at Playhead.
    Matt

  • How can i display a list of all the names stored in the Mail app?

    When sending an email, the program shows a list of names according to the first and subsequent letters that I type into the To: field. There are times I cannot recall someone's email user name. How can I display a complete list of all the names Mail has stored? I know that I can go to the To: field then type in the letter A, then write down all listings under A, and then repeat for each letter of the alphabet, but there should be an easier method.
    I have perhaps dozens of names in Mail, but only five names in Address Book, so the latter does me no good.

    On the menubar, Mail > Window > Previous Recipients
    Regards,
    Captfred

  • How can I get the XML structure from a flat structure?

    Hi all,
    in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
    The structure that I receive have this format:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
    <NumberRecordType_B><NumberRecordType_c>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    and the customer don't want to insert a line separator.
    Then, the question is:
    How can I get the XML structure from this structure?
    If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
    PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
    Best Regards,
    Paolo

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • How can I display more than one value in Calendar ?

    Hi,
    the standard (example) script allows for the display of one value only (as I understood). How can I display two or three values, from the very same table ? Students of mine during an HTMLDB workshop in Leipzig did ask that question.
    Do we have a more detailed docum. on the use of the calendar ?
    pls kindly advise. TIA.
    Bernhard

    my solution:
    Source fo the calendar starts:
    snip>
    declare
    q varchar(32767) := null;
    begin
    q := 'select "ETA", <--- Date Field and concatination of fields as follows:
    "SCHIFFSNAME"|| "ETA_TIME"|| "TERMINAL"||''(br*)'',
    null,
    null,
    null,
    null
    from "#OWNER#"."SCHEDULE"'; . . . . . . .
    snip>
    comment on (br*) - you have to use "<" and ">" instead of "( " and ")" to have the "break/new line effect"
    brgds
    Bernhard

  • How can I display images that are not included in any collection?

    How can I display images that are not included in any collection (some filter or smart collection)? A smart collection with parameters "Collection - contains - empty field" does not work. Lightroom 5.

    Thank you! Good idea! I ordered letters of the alphabet (space separated), and it works.

  • How can i display all the query items to a table?

    how can i display all the query items to a table in a jsp file?
    i always have an out of memory error..

    any body??any idea?
    is it possible thru configuration or i have to write a program by the abaper??
    Biswa

  • How can I display all my e-mails.  Only some of them show up now...thanks to an apple representative in the apple store

    How can I display all my e-mails on all my Apple products?  Only some of them show up now...thanks to an apple representative in the apple store.  Also, he put my oldest emails in POP (???)

    How can I display all my e-mails on all my Apple products?  Only some of them show up now...thanks to an apple representative in the apple store.  Also, he put my oldest emails in POP (???)

Maybe you are looking for

  • Download Arabic text using GUI_DOWNLOAD

    Hi Experts, I am using GUI_DOWNLOAD to download the contents of an internal table to a local text (.txt) file. The internal table contain Arabic characters also. The Arabic characters appear as # in the downloaded text file. Please help to resolve th

  • Bridge Image Processor TIFF format

    I use Bridge's Image Processor to batch JPEG images to TIFFs before Photoshopping them, but I've noticed that it saves TIFFs with Mac byte order by default. This isn't usually a problem, but many of these images will move to another department in my

  • Downgraded to itunes 6.0.5 and still having problems. HELP

    I just downgraded from 7 to 6.0.5 and for whatever reason itunes still slows down the whole works when ripping, rips at really slow (3-4x) speeds, and plays all garbled when trying to do more than one thing at a time (i.e. use any other program in co

  • Don't want zip files as attachments

    Sometimes a document such as Word or Excel will appear as a zip in my message when I attach it. I do not want to send a zip file. How can I stop Apple from converting it? I have an iBook G4 with Tiger. Yahoo says they are not doing it, problem is cau

  • Changing the back of iPhone 3GS

    I would really like to change my black back to a white one. If I took my phone to the store - could this be arranged? I'll pay whatever.