How to create JTree horizontally?

Can I create a GUI tree which has its stem horizontally using java?
TIA.

I'd take a look at swinghelper's transformer, which allows you to rotate swing components. It is an experimental project, but still worth a look:
http://weblogs.java.net/blog/alexfromsun/archive/2006/07/jxtransformer_t.html
You could also override paint(), and tweak the transformation of the passed graphics. You would also have to override the get*size() methods, and translate the coordinates of the mouse events.

Similar Messages

  • How to create a horizontal collage in PSE 9

    How do I create a horizontal collage in PSE 9?  It will only let me do a vertical layout.

    Select one of the vertical templates and then use the Editor main menu:
    File >> Save As
    Then choose PSD and save to your desktop.
    Close the collage project and then use:
    File >> Open and navigate to your saved PSD file
    Then use the menu:
    Image >> Rotate (90 degrees left or right)
    Click window >> Layers
    In the layers pallet highlight each layer with an image/place holder and select the move tool to position/rotate/scale each one individually.

  • How to create a horizontal multi column menu?

    We are trying to create a horizontal menu, just like the one at Oracle site ( [http://www.oracle.com/us/index.html] ) with links in multiple columns in each menu item. Can you please suggest how to do it? We have tried using the navigation model but could only create single column menus.

    Put the links in a form and set the rows and columns properties of the Form.
    See the options on this page:
    http://jdevadf.oracle.com/adf-richclient-demo/faces/visualDesigns/formLayout.jspx

  • How to create a horizontal menu?

    Am using studio creator 2 and there is no provision to create a horizontal drop down menu. how do i make one? (a list of items will drop down when the mouse hovers over a menu item)
    I have used samples from http://www.milonic.com and i am supposed to add this to the page using the menu::
    <script type="text/javascript" src="milonic_src.js"></script>
    <noscript>JavaScript Menus and DHTML Menus Powered by Milonic</noscript>
    <script type="text/javascript">
    if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
    else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>");
    </script>
    <script type="text/javascript" src="menu_data.js"></script>
    however, there are problems with the this part
    "<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>"
    can someone help me please.......i need this urgently :-(

    this is the what is there at the source of the blank page::
    <?xml version="1.0"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta content="no-cache" http-equiv="Pragma" />
    <meta content="no-cache" http-equiv="Cache-Control" />
    <meta content="no-store" http-equiv="Cache-Control" />
    <meta content="max-age=0" http-equiv="Cache-Control" />
    <meta content="1" http-equiv="Expires" />
    <title></title>
    <script type="text/javascript" src="/homePage/theme/com/sun/rave/web/ui/defaulttheme/javascript/formElements.js"></script>
    <link rel="stylesheet" type="text/css" href="/homePage/theme/com/sun/rave/web/ui/defaulttheme/css/css_master.css" />
    <link rel="stylesheet" type="text/css" href="/homePage/theme/com/sun/rave/web/ui/defaulttheme/css/css_ie55up.css" />
    <script type="text/javascript">
    var sjwuic_ScrollCookie = new sjwuic_ScrollCookie('/home.jsp', '/homePage/faces/home.jsp');
    </script>
    <link id="link1" rel="stylesheet" type="text/css" href="/homePage/resources/stylesheet.css" />
    </head>
    <body id="body1" style="-rave-layout: grid">
    <form id="form1" class="form" method="post" action="/homePage/faces/home.jsp" enctype="application/x-www-form-urlencoded">
                            <script type="text/javascript" src="resources/milonic_src.js"></script>
                            <noscript><a href="http://www.milonic.com/">JavaScript Menus and DHTML Menus Powered by Milonic</a></noscript>
                            <script type="text/javascript">
                                if(ns4)_d.write("<scr"+"ipt type=text/javascript src=resources/mmenuns4.js><\/scr"+"ipt>");
                                else _d.write("<scr"+"ipt type=text/javascript src=resources/mmenudom.js><\/scr"+"ipt>");
                            </script>
                            <script type="text/javascript" src="resources/menu_data.js"></script>
    <input id="form1_hidden" name="form1_hidden" value="form1_hidden" type="hidden" />
    </form>
    </html>i just cant figure out where i am doing wrong. I have saved the mmenudom.js, mmenuns4.js, milonic_src.js and menu_data.js files in the resouces folder of the project.

  • How to create JTree without root node

    Hello;
    I like to create a JTree without root node?
    Any help?
    Thanks!
    --tony                                                                                                                                                                                   

    javadocs JTree,
    setRootVisible
    public void setRootVisible(boolean rootVisible)
    Determines whether or not the root node from the TreeModel is visible.
    Parameters:
    rootVisible - true if the root node of the tree is to be displayedSee Also:
    rootVisible

  • How To Create Gradient Horizontally, Top to Bottom

    Within Illustrator CS4, I created a rectangle.
    Is it possible to fill the rectangle using a gradient with the gradient occurring from the top of the rectangle towards the bottom edge, essentially having long strips of color from left to right within the rectangle?
    It appears that the gradient tool fills in the rectangle using vertical bars, and I would like to have long horizontal strips.
    Is there some way to rotate the fill so the gradient happens in the other direction?

    look in your gradient panel - window -> gradient
    That middle field with the 0 in it is the angle of your gradient.  you want 90˚ or -90˚

  • How to create a horizontal full screen banner filled with sideways moving graphics?

    Well, that is the question.
    Spec: The banner should be the width of the page (or the screen),the width should be about 10% of the screen height, and a fixed series of pictures or graphics should be continually moving gently sideways inside this banner, filling the banner.
    Note: I have Studio VII extensions at my disposal, and a whole bunch of others, but since I am new to Dreamweaver, I have not tried them all out; and so far, Studio VII inserts or behaviors have not answered my question (or I did not persist hard enough to get one of them fulfill my needs).
    Slide Show Magic? Vertical or Horizontal Scroller? ShowPicLayer? Image Gallery Magic? ...all by Studio VII.. or anything else, as long as it gets images moving sideways in a banner.

    First you need to build a container for your header and since you want it to be liquid (flex to size of viewport), you'll need to use a width in percentages rather than pixels.
    Example of liquid header can be seen here: View page source to see the CSS and HTML code.
    http://alt-web.com/DEMOS/Liquid-header.shtml
    Second, use Flash to build your moving picture banner.  For detailed info on that, consult the Flash Forum.
    HTH,
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/

  • How to Create a Horizontally Scrolling Portfolio

    There are a couple of great portfolio sites in the Adobe Site of the Day with a series of images that move to the left as the user scrolls down. The one I like best is not a one page website. It has a navigation menu that stays pinned to the top and each page in the site stands on its own as in any other website. This is it: http://www.erickusters.nl/
    I admit I'm a little crazy to be wanting to tackle something like this when I've never used parallax scrolling at all but, like this designer, I have worked in a wide variety of media and have a lot of work I want to present.
    I have watched every tutorial I can find and played with the program a fair amount but I haven't been able to figure out how to achieve this. Somebody on one website suggested making the website extremely wide but I tried looking at this site's source code and it doesn't look like that's what he did. . .  although the code was almost impossible for me to make heads or tails out of so I may have missed something. (I know html and basic css but this is beyond me.)
    Any guidance on this?
    Thanks!

    Hello Bernd, thank you very much for response.Actually, What do u mean a package may be it can be helpful for me.....can ı manage my contracts with Package?

  • How can I create a horizontal scrollbar with a centered thumb that scrolls content from both sides?

    I am having trouble figuring out how to create a horizontal scrollbar component either by itself or nested inside a data list component that will have it's thumb centered in the track when running and reveal content from either the right or left side when the thumb is moved. The furthest I have managed to get is to create a data list component with a scrollbar component inside that has a centered thumb that reveals content from the right side of the list (0 through 10 of the items) but only reveals blank area when tracking the other way. Is there a way to create say… negative items in the data list… 0 through -10? Or am I approaching this the wrong way. Please help. Thanks.

    Mykola,
    Thanks. I guess I was hoping for an answer that addressed my question from a designer's point of view rather than a developers'. As a designer with over ten years experience using Adobe products for print work it is difficult to understand why "centered" is such a complicated concept when designing art for use on the web. It is so frustrating to realize that most containers for images and text can only be resized by pushing and pulling handles located on the right and bottom; Catalyst seems like a great start but if Adobe really wanted to impress the "design" community it might consider putting all that supercharged code underneath the hood of some more familiar "design" tools. Maybe a "catalytic converter" would allow the introduction of a "centered" tool for every element.
    After all, why is it literally twenty-five times more difficult, requiring the use of three additional programs to create a component that functions exactly like a typical data list and scroll bar with the exception that the thumb is "centered" on the track and reveals images from both the right and left. For that matter why not also have as an option a thumb that snaps to the bottom of the track and reveals images from the top… and one that snaps to the right and reveals images from the left when you run the project? It just seems so logical to expand the scroll bar component to include these options.
    I am very glad to have Catalyst and will redesign my project to fit within the constraints of the tools available in the program but it seems that if Adobe is really serious about Catalyst being a window into the world of web design for designers/AD's that perhaps it might benefit by focusing on what might improve the program from the designer's point of view. I hate to say it but the Catalyst forum is already rife with answers to questions that are riddled with code… Literally. And to be honest most designers don't have the time to decipher that code. As a designer I work regularly and have a deep understanding of Photoshop, InDesign, Illustrator, Acrobat Pro, Final Cut Pro, Final Draft and modo. I do hi-res assembly, retouching, design and layout, identity, production, 3D modeling and rendering, video editing… and before I switch to using Catalyst for web mock-ups I am going to need a more "designer" friendly set of tools and definitely a "centered" control.
    I really think Adobe is fantastic. But I also think it could take a lesson from a great little company called Luxology. I tried learning 3D modeling and rendering for years with programs like Lightwave, Maya and others, always with mixed results. Then Luxology came along and actually delivered on their promise to create a 3D program for artists. What was the factor that made all the difference? Well, besides the Apple award winning interface and sets of tools it was the training available on their sight. The program itself ships with thirty-six hours of quicktime movies. And hundreds more hours available for download. I have never yet not been able to quickly and easily find an answer to a question I had about how to accomplish something in modo. You know how long I have already spent on Adobe TV searching through videos and on the Catalyst forum searching through topics trying to get an answer to what I thought was a very simple question? Way too many. If I have a question about a Luxology product that I can't find the answer to do you know what I do? I call Brad Peebler, the President of Luxology. I'm not special nor do I work for some special development house with special privileges that is simply their policy. And that policy has paid big dividends. Both ILM and Pixar has licensed their technology.
    Well… I apologize for this long response but I really think that if Catalyst is going to attract the market it wants that it will have to consider putting some designers on the development team. After all… Isn't that what the promo videos tout… Finally a web design program for designers. Well, I guess we'll see.
    Karl

  • How to create Horizontal scrollbar

    I am using Form6i, how to create a horizontal scrollbar for a multi-record block?
    Thanks!

    A horizontal scroll bar is not an object that you can drag or resize like a vertical scrollbar. It is implicitly created when needed.
    To get a horizontal scroll bar, you have to place the items you want to scroll on a STACKED CANVAS and set property Show Horizontal Scroll Bar of this canvas to Yes.

  • How can I create a horizontal line under a line of text?

    Hi,
    I have FM 12.0.3.424.
    Does anyone know how to create a horizontal line under heading text that is the width of the page?  Similar to creating a border but without the top and sides.
    Is it even possible?
    thank you in advance!

    Use the "Frame Below" attribute in the Advanced tab of the Paragraph Designer for your heading tag to use a named Reference Frame from your Reference page. If you're using the default templates for your documents, you could try the Single Line selection (or make your own).

  • Creating a Horizontal Thermometer

    Does anyone know how to create a horizontal thermometer display for the Front Panel (instead of the vertical one)?  The closest thing I have at the moment is using a horizontal fill slide and changing the color to red.  Is there any better way than this?
    Thank you,
    Joshua
    PS: I'm running LabVIEW 8.2

    A horizontal progress bar would have a bit more of a 3D effect than a fill slide.
    (You could even add a decorative red LED to the right for some cosmetic effect ).
    Message Edited by altenbach on 04-19-2007 10:20 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    HorizTherm.png ‏4 KB

  • How do I create a horizontal nav-bar with CSS, set to an exact width?

    I have a problem that I need help with. All I need to do is
    to create a simple text-based horizontal navigation bar using CSS.
    I have seen many CSS tutorials online about how to make a
    horizontal navigation bar using unordered lists, but they all seem
    to either set the bar to be centred or to the full width of the
    page, or if they do set it to be a certain width, then the buttons
    within that width are centred within pre-defined widths for each
    one.
    Unfortunately none of these help me - let me explain my
    scenario...
    I have an area that is exactly 700px wide. In this area I
    want to put 5 text hyperlinks.
    I want the first text-link to be aligned to the left of my
    700px width, and I want the last text-link to be aligned to the
    right of the 700px width.
    I want the spaces between each of these text-links to all be
    the same.
    The only definite known width is the overall 700px. I will
    not know the width of each text-link, as (a) they are all live
    text, and (b) the phrases for each could change.
    I have mocked up a quick diagram showing in more detail
    precisely what I mean:
    http://www.nothowitlooks.com/temp/navbar.gif
    Can anyone please help me with this?
    Thanks.

    .oO(BrettArchibald)
    >Oh look, a third person joining the discussion and not
    actually proposing any
    >solutions to the original query. Just what this thread
    needs.
    Oh look, a person seeking for help turning into a troll. Just
    what this
    group needs.
    > Well, to be fair, Kim did make a sterling effort in
    trying, but just didn't
    >manage to fully understand the layout required.
    >
    > To address your "points":
    >
    quote:
    some things simply can't be done or don't make any sense in
    the Web. Even a
    >client has to accept that. Let them write wishes to Santa
    Clause if they want,
    >but they have to accept the rules of the medium they're
    working with.
    >Period.
    > Wrong, wrong, silly comment and wrong.
    >
    > To elaborate: firstly, with regards to design,
    everything can be done, it's
    >simply a matter of how.
    Only in your fantasy. In practice there are always some
    limits enforced
    by the used material or technology. You simply can't violate
    such basic
    rules and laws, even if you would like to.
    >Whether you use text, images, tables, CSS, or even
    >Flash, the objective is first to design the site with
    both your client's and
    >their customers needs and expectations, and then to build
    it, regardless of how
    >difficult-to-code that design may or may not be.
    It always looks good on paper, but not every design can be
    turned into
    practice. This not only applies to web design, but to almost
    every kind
    of development. Often enough you have to find compromises or
    workarounds
    if the engineers say "won't work". The problem is that many
    designers
    don't understand this or don't want to. They're just thinking
    and living
    in their perfect theoretical world, but have no idea of how
    things work
    in the real world. And many theoretical things simply don't
    work there.
    Each medium has its own rules and laws. Some things may work
    well for a
    printed paper for example, but not in the Web and vice versa.
    Of course
    you can try to break these rules, but you'll definitely fail.
    >You should not compromise your
    >design because of a lack of coding knowledge.
    It's not lack if coding knowledge if you refuse to try things
    that are
    impossible or don't make sense. It's quite the opposite,
    because you
    don't have to waste your time with something that won't work
    at all.
    >If you don't know how to do it
    >yourself, then find out how to do it (which is what I was
    *originally* trying
    >to do here, remember?).
    Quite easy. Surf the web, and if you see something like what
    you want,
    just have a look at the source code or post the URL here. If
    it can be
    done, then it already has been done. Just show us an example
    and we'll
    happily explain it to you.
    > Secondly, no, a client does NOT have to accept that
    "some things simply can't
    >be done or don't make any sense in the Web".
    Sure they have. The client is not always king. And if they
    insist on
    stupid things and always know it better - why the hell are
    they hiring
    you instead of doing it themselves? If they want their work
    to be done
    by an expert, they should also _listen_ to that expert and
    let him do
    his work properly instead of telling him how he should do it.
    That's not
    going to work.
    >Like I said earlier, some clients
    >are not interested in hearing about how what they want
    cannot be done, and any
    >attempts to tell them so only serve to convince them to
    take their work, and
    >their money, to someone else. Most clients, thankfully,
    are adaptable and
    >willing to reason. However, some are not, and if these
    clients take their money
    >elsewhere, you lose the job and you don't get paid. It's
    that simple.
    Let's say you want a little film to be made about whatever.
    Would you
    tell the director where he should position the cameras, the
    lights and
    all the stuff? He already knows _what_ you want to get, so
    why don't you
    just let him decide _how_ to do it? It's his job! And if he
    says that
    filming directly towards bright sunlight usually doesn't work
    well, you
    should respect his expert opinion.
    >
    quote:
    You won't make friends here with such an attitude. Please
    stop insulting
    >regulars or just leave.
    >
    > Firstly, I'm not here to make friends. Neither am I here
    to make enemies. I am
    >here to get help with a coding problem. When people offer
    "alternative advice"
    >that hinders my progress in finding a solution, I tell
    them so. I give back
    >what I get.
    You asked for advice and you got proper answers. We really
    don't need
    people here just looking for the answers they want to hear.
    Often enough
    people are coming here looking for a cure to a particular
    problem, while
    it would be much easier to avoid that problem right from the
    beginning.
    Of course if they don't want to hear such alternatives -
    their problem.
    > Secondly, I was not aware that "regulars" to this site
    had any special
    >"insult-free privileges" or suchlike that newcomers did
    not.
    It's not the best idea to bite the hand that feeds you. It's
    the group's
    regulars who answer almost all of the questions here. And
    most of them
    also know how to use a killfile.
    >I don't care if
    >someone is a regular or a newcomer - when I ask a
    technical question and
    >instead of either potential advice or even silence, I
    instead receive
    >un-warranted "design advice", I'll make my opinions
    known.
    So do we. If someone wants something that's not possible or
    not going to
    work, we'll "make our opinions known". After all that's what
    a free
    discussion board/forum/group is for.
    > As for the "just leave" suggestion for supposedly
    "insulting regulars", I
    >could very well say the exact same thing to you, for the
    reason of not actually
    >contributing anything to the discussion that attempts to
    address the original
    >query of this thread.
    > In fact, you know what, I think I will. Here goes:
    > Please either propose a solution to my original CSS
    problem or just leave.
    > There, how was that?
    Want to try again?
    With pure CSS and text links it can't be done within the
    given
    constraints. I even doubt that it's possible with a table. So
    either
    drop the fixed 700px width or the equal space between the
    buttons.
    > P.S: Seeing as though pedantry seems to be something
    you're interested in,
    >judging by the "rant" tag comment, I thought I'd point
    out that you spelled
    >Santa Clause wrong.
    You can keep the 'e'. In German we have more than enough of
    them.
    And if you would be familiar with web design, then you would
    have known
    where this ironic "error message" came from.
    Your turn.
    Micha

  • How to Create XML Schema From JTree ?

    Please help me... Thank you.
    This is Code
    Tree.java ----- Run This File
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class Tree extends JPanel implements ActionListener {
        private int newNodeSuffix = 1;
        private static String ADD_COMMAND = "add";
        private static String REMOVE_COMMAND = "remove";
        private static String CLEAR_COMMAND = "clear";
        private static String OK_COMMAND = "ok";
        private DynamicTree treePanel;
        public Tree() {
            super(new BorderLayout());
            //Create the components.
            treePanel = new DynamicTree();
            //populateTree(treePanel);
            JButton addButton = new JButton("Add");
            addButton.setActionCommand(ADD_COMMAND);
            addButton.addActionListener(this);
            JButton removeButton = new JButton("Remove");
            removeButton.setActionCommand(REMOVE_COMMAND);
            removeButton.addActionListener(this);
            JButton clearButton = new JButton("Clear");
            clearButton.setActionCommand(CLEAR_COMMAND);
            clearButton.addActionListener(this);
            JButton okButton = new JButton("OK");
            okButton.setActionCommand(OK_COMMAND);
            okButton.addActionListener(this);
            //Lay everything out.
            treePanel.setPreferredSize(new Dimension(300, 150));
            add(treePanel, BorderLayout.CENTER);
            JPanel panel = new JPanel(new GridLayout(0,1));
            panel.add(addButton);
            panel.add(removeButton);
            panel.add(clearButton);
            panel.add(okButton);
            add(panel, BorderLayout.LINE_END);
        /*public void populateTree(DynamicTree treePanel) {
            String p1Name = new String("Parent 1");
            //String p2Name = new String("Parent 2");
            String c1Name = new String("Child 1");
            //String c2Name = new String("Child 2");
            DefaultMutableTreeNode p1;
            p1 = treePanel.addObject(null, p1Name);
            //p2 = treePanel.addObject(null, p2Name);
            treePanel.addObject(p1, c1Name);
            //treePanel.addObject(p1, c2Name);
            //treePanel.addObject(p2, c1Name);
            //treePanel.addObject(p2, c2Name);
        public void actionPerformed(ActionEvent e) {
            String command = e.getActionCommand();
            if (ADD_COMMAND.equals(command)) {
                //Add button clicked.
                treePanel.addObject("New Node " + newNodeSuffix++);
            } else if (REMOVE_COMMAND.equals(command)) {
                //Remove button clicked.
                treePanel.removeCurrentNode();
            } else if (CLEAR_COMMAND.equals(command)) {
                //Clear button clicked.
                treePanel.clear();
            } else if (OK_COMMAND.equals(command)) {
                 //Ok button clicked.
                 treePanel.ok();
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("Craete XML Tree");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            Tree newContentPane = new Tree();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }DynamicTree.java
    import javax.swing.JOptionPane;
    import java.awt.GridLayout;
    import java.awt.Toolkit;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.MutableTreeNode;
    import javax.swing.tree.TreePath;
    import javax.swing.tree.TreeSelectionModel;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    public class DynamicTree extends JPanel {
        protected DefaultMutableTreeNode rootNode;
        protected DefaultTreeModel treeModel;
        protected JTree tree;
        private Toolkit toolkit = Toolkit.getDefaultToolkit();
        public DynamicTree() {
            super(new GridLayout(1,0));
            rootNode = new DefaultMutableTreeNode("Root Node");
            treeModel = new DefaultTreeModel(rootNode);
            treeModel.addTreeModelListener(new MyTreeModelListener());
            tree = new JTree(treeModel);
            tree.setEditable(true);
            tree.getSelectionModel().setSelectionMode
                    (TreeSelectionModel.SINGLE_TREE_SELECTION);
            tree.setShowsRootHandles(true);
            JScrollPane scrollPane = new JScrollPane(tree);
            add(scrollPane);
        /** Remove all nodes except the root node. */
        public void clear() {
            rootNode.removeAllChildren();
            treeModel.reload();
        public void ok() {
             int n = JOptionPane.showConfirmDialog(null, "Do you want to create XML Schema?", "", JOptionPane.YES_NO_OPTION);
        /** Remove the currently selected node. */
        public void removeCurrentNode() {
            TreePath currentSelection = tree.getSelectionPath();
            if (currentSelection != null) {
                DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode)
                             (currentSelection.getLastPathComponent());
                MutableTreeNode parent = (MutableTreeNode)(currentNode.getParent());
                if (parent != null) {
                    treeModel.removeNodeFromParent(currentNode);
                    return;
            // Either there was no selection, or the root was selected.
            toolkit.beep();
        /** Add child to the currently selected node. */
        public DefaultMutableTreeNode addObject(Object child) {
            DefaultMutableTreeNode parentNode = null;
            TreePath parentPath = tree.getSelectionPath();
            if (parentPath == null) {
                parentNode = rootNode;
            } else {
                parentNode = (DefaultMutableTreeNode)
                             (parentPath.getLastPathComponent());
            return addObject(parentNode, child, true);
        public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
                                                Object child) {
            return addObject(parent, child, false);
        public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
                                                Object child,
                                                boolean shouldBeVisible) {
            DefaultMutableTreeNode childNode =
                    new DefaultMutableTreeNode(child);
            if (parent == null) {
                parent = rootNode;
            treeModel.insertNodeInto(childNode, parent,
                                     parent.getChildCount());
            //Make sure the user can see the lovely new node.
            if (shouldBeVisible) {
                tree.scrollPathToVisible(new TreePath(childNode.getPath()));
            return childNode;
        class MyTreeModelListener implements TreeModelListener {
            public void treeNodesChanged(TreeModelEvent e) {
                DefaultMutableTreeNode node;
                node = (DefaultMutableTreeNode)
                         (e.getTreePath().getLastPathComponent());
                 * If the event lists children, then the changed
                 * node is the child of the node we've already
                 * gotten.  Otherwise, the changed node and the
                 * specified node are the same.
                try {
                    int index = e.getChildIndices()[0];
                    node = (DefaultMutableTreeNode)
                           (node.getChildAt(index));
                } catch (NullPointerException exc) {}
                System.out.println("The user has finished editing the node.");
                System.out.println("New value: " + node.getUserObject());
            public void treeNodesInserted(TreeModelEvent e) {
            public void treeNodesRemoved(TreeModelEvent e) {
            public void treeStructureChanged(TreeModelEvent e) {
    }

    XML shema is basically an XML file. So u need to know how to create an XML,
    provided u know how the shema file should be.
    Creating an XML :
    http://forum.java.sun.com/thread.jspa?threadID=5181031&messageID=9705786#9705786

  • How can create a JTree with cellRender is checkbox realized multiple selec

    How can create a JTree with cellRender is checkbox realized multiple selection function.thanks for every
    one's help.

    Hi,
    1. Create a value node in your context name Table and set its cardinality to 0:n
    2. Create 2 value attributes within the Table node name value1 and value2
    3. Goto Outline view> Right click on TransparentUIContainer>Apply Template> Select Table>mark the node Table and it's attributes.
    you have created a table and binded its value to context
    Table UI properties
    4.Set Selection Mode to Multi
    5.Set Visible Row Count to 5
    6.ScrollableColCount to 5
    In your implemetaion, you can add values to table as follow:
    IPrivate<viewname>.ITableElement ele = wdContext.nodeTable().createTableElement();
    ele.setValue1(<value>);
    ele.setValue2(<value>);
    wdContext.nodeTable().addElement(ele);
    The above code will allow you to add elements to your table node.
    Regards,
    Murtuza

Maybe you are looking for

  • How to install J2EE on a windows machine

    I am following the oracle tutorial on how to use JMS, as I am learning it, but I am having problem with J2EE. I downloaded j2ee with sdk and installed it and it gives me an unsupported platform error. I am running 64bit Windows 7 which is supported.

  • Diadem csv problem with importing

    I am opening a CSV file and it is only importing the last Channel as a text channel, but it is a numeric channel, not a text. To generate the CSV file, I am parsing a hex file into the csv file. I am at the end of my wits as I cannot even change the

  • Creating a Price in 1 table, determined by data contained in multiple other tables.

    Hi I'm trying to construct a quote tool for my resellers and partners. My software product has a different selling price determined by the licence type, licence size and some vertical market positioning. In my example, if my partner ticks the box for

  • Macbook Pro Core i5 and Color

    Hi I've never used Color on a Macbook Pro, only on a Mac Pro Anyone out there running Color on the new Core i5 Macbook Pros? How does it run? Is there an improvement over the previous generation? I'm not after stats/benchmarks, I want real world feed

  • Trouble loading Java app

    I'm a newbie.I'm getting this error in trying to run a program. Java(TM) Plug-in Fatal Error Several Java Virtual Machines running in the same process caused an error. I have cleared out Java and reloaded 6.0. When I try to run the desired windows ap