URGENT----- JTree Event

I have a JTree with parent node---- PARENT1.
To it are added CHILDNODE1 and CHILDNODE2.
Another parentnode PARENT2 with CHILDNODE3 CHILDNODE4.
PARENT1 and PARENT2 added to ROOTNODE
JTree is added to LHS of JSplitPane
Similar to Explorer in Windows.
Added listeners to JTree like this
mTree.addTreeSelectionListener(new TreeHandler(this));
mTree.addMouseListener(new TreeHandler(this));
where TreeHandler is a class extending MouseAdapter and implementing TreeSelectionListener.
Overidden public void valueChanged(TreeSelectionEvent aTreeEvent)
by calling aTreeEvent.getPath() and from the obtained path, I determine PathCount and PathComponent.
Based on this I display Panel on RHS of JSplitPane.
I have a situation say CHILDNODE1 is selected and corresponding Panel is displayed. If I select CHILDNODE2 with mouse, I prompt for saving changes made to CHILDNODE1 panel...So I should reselect CHILDNODE1 in JTree programmatically and not CHILDNODE2
I have used mTree.setSelectionPath(path_of_CHILDNODE1) .
But the problem is it is triggering an event on selection of CHILDNODE1, which I donot want to. How do I stop this????
and also will call to mTree.setSelectionPath(aPath) trigger a TreeSelectionEvent or my event handling is wrong ?
Thanks in advance

If I have understood clearly ur problem, When the other cell in the tree is selected the corresponding rHS componet will be updated is that right. And wht U wanna do is to holp updationg rhs before saving previous content.
If that is right, then y dont U ask for the save option in the treeevent itself?i mean in the overridden value chnaged function

Similar Messages

  • Plz Help...It is URGENT.JTREE

    Hi All:
    I am developing a Application where I am populating my Jtree from the database.Now the Problem is when I click on one of the Nodes of the Jtree,I am unable to populate the Jtree-window(along with the Jtree) with my JInternalFrame in one the Split Windows(SPlitPane is used).[i.e the left pane consists of Jtree & the right pane consists of JInternalFrame].
    How to activate and properly set the window.
    Help is urgent.Provide me some pointers plz/Source COde.
    Thanking you.
    Sincere
    Regards
    Ritesh

    Dear DrCLap:
    Thanks for the reply.
    Let me explain my problem.Deadline is there.
    Well I am having a Jtree(dynamically updated from Database) added to 1 Split Pane.
    I am having a Popup-Menu with items namely Add,View and close with the ActionListener Interface.
    When I click the LastNode of the JTree,I am firing a Popup Menu and the Add Event when I click Add.
    But after clicking the "Add",the Layout is completely occupying the Window and destroying the Jtree.,i.e.I am unable to see the JTree.And when I finally add a new node ,I am unable to refresh the JTree.
    Help me.
    Regards
    Ritesh

  • Urgent- Mouse Event ..problem..

    Hello
    I am developing a client server application.
    The client when receives some messages processes it,which is in a while Loop and this while loop is in a thread...these messages are recieved from the server. The client has a gui..on which I want to listen to MouseEvent...so I have overridded processMouseEvent() and for the enableEvents() of components I have used a mask for only the mouseEvent.
    The problem is that it never comes into this method,which should actually come as I have used the enableEvent() of the Component class("will allow the specified event even if a listener is not added").
    What could be the problem?????
    Say
    Class XClient extends Jframe implements Runnable()
    .open a socket connecting to server say "socket"
    input = new DatainputStram(socket.getinputStream);
    ..public void start(){
    enableEvent(AWtEvent.MOUSE_MOVE_EVENT);
    Thread t = new thread(this);
    t.start();
    public void run(){
    while(true){
    String s = input.readUTF();
    processMessage(s)
    protected void processMouseEvent(MouseEvent e){
    do some processing....
    Its urgent.
    Thank you in advance..
    regards
    Oliver

    Dear Friend
    Change the code from
    enableEvent(AWtEvent.MOUSE_MOVE_EVENT);
    to
    enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);

  • JTree event question

    Hi,
    I am facing a problem and hoping somebody here can give me a clue.
    I have a JTree in my application, which has different types of nodes (all implement TreeNode ). One node there needs lazy-loading, what I want is when user clicks either '+' or folder icon/label then this node gets updated. I have added MouseListener to the tree, it works fine with clicking folder icon or label but not for clicking '+'. I also tried adding other listeners like TreeWillExpand etc. but it not seems a good solution to me since I just need to treat one node defferently.
    There are a couple of options I think can help:
    - catch clicking '+' event for specific node
    - display '+' even folder has no child (just for one node)
    - or disable '+' for this node
    Thank you in advance

    Well, after you expand row 1, the row count isn't 6 anymore, is it? It's something larger than that, depending on how many children the first node has.

  • Urgent: Timer Event

    Hi,
    i have a scenario, were i want to have timer event.
    ie enduser login to the portal(they will do their work in the application ),behind a timer will be running and  after 30 minutes i want to tigger a event.
    if the application is running more than 30 minutes i want print a message, How to know that application is running from last 30 minutes.
    Its urgent & will be Appreciated.
    Thanks
    Maha

    Hi
    I think you must use the IWDTimedTrigger, that automatically triggers an event with specified delay.
    You can set the delay property for the UI element and set it according to your need.
    Hope this link may help you.
    http://help.sap.com/saphelp_nw04/helpdata/en/03/7c6b40dde0980ae10000000a155106/content.htm
    Regards
      - Vinod

  • URGENT:PR event not triggering

    Hi Experts,
                  I am creating a PR through me51n.It should create an event of BUS2009(Releasestepcreated).But not event is triggering.Is it related to some setting in SPRO.Please help me

    Hi Vivek,
    Hope you have gone thru' SAP help for the  customizing requiredfor this scenaro.
    Pls re-check all your customizing steps from MM side and also if you have mentioned the workflow indicators in the MM config, which indicate that workflow has to be used for release starategy.
    Regds,
    Akshay

  • Urgent: onload event in HTMLB

    Hi,
    I am not able to find out what is the name of the event when HTMLB form control gets loaded.
    I am doing some mathematical operations on form load event.
    i.e.In HTML we write <body onLoad "abc()">
    where abc() is a java script function.
    Could anyone please tell me how I can achieve the same in HTMLB?
    I am using HTMLB tagLibs
    The sample format of my code is as follows
    <%@ taglib uri="tagLib" prefix="hbj" %>
    class="src.api.CreateDDSBean" />
    <hbj:content id="createDDSContext" >
      <hbj:page title="createDDSPage">
        <script language="javascript">
         function abc()
        </script>
       <hbj:form id="formCreateDDS">
           //some jsp code with htmlb taglibs
       </hbj:form>
      </hbj:page>
    </hbj:content>
    From where I can get the information regarding various trigger events for various controls?
    Thanks
    Parag

    Hi,
    And to make it more easier to update you could do something like this:
    <script language="JavaScript">
    // alert box
    function abc(){
      alert('this is function abc');
    // set window status
    function xyz() {
      window.status = "this is xyz function";
    // functions for onload
    function myonload() {
      abc();
      xyz();
    window.onload=myonload;
    </script>
    Regards,
    Ville

  • Urgent : One Event alert Cause another Event Alert to Fire Aslo

    Dear Friends,
    i have two event alerts say :
    xx_employee_termination (After Insert - on PER_ALL_PEOPLE_F) -- Fires once i terminate any employee.
    xx_proposal_approved (after update - on PER_PAY_PROPOSALS) -- Fires once i approve any proposed salary
    my issue is
    When i terminate any employee it will update also PER_PAY_PROPOSALS which cause xx_proposal_approved alerts to fire if his status is (Approved)
    So, How to stop firing of Proposal Alert if i terminate any employee?
    Waiting for help friends,
    Regards,

    some would say why did you keep PER_ALL_PEOPLE_F instead of (per_periods_of_service)
    it is same..
    termination would affect Per_all_people_f ,per_pay_proposal ,,,,etc

  • Urgent, merged events

    On my external hard drive I have my Final Cut Events folder set up. The videos that were located in the sub folders were not imported through FCPX but placed in there manually. In FCPX under the year tab there were a list of the events. There were no clips seen by FCP but they were there on the external drive. The events were merged in FCPX but in doing this FCPX seems to have gotten rid of all the files that were in the event folders on the external drive. I can not locate them in my Trash, or anywhere in FCPX. Is there a way to recover this data?

    You really set yourself up for disaster by putting files manually into the Events folder, do a spotlight search for the missing files by name hopefully FCPX put them into a temp folder somewhere.
    Best luck.

  • Urgent:Proration Event group Not firing

    Hello,
    I have setup a Proration event group. What i find is if i set an element with the termination rule as Last Standard Process, then Pro-ration event group doesnt fire , however
    if the termination rule is set as Actual termination rule , then the proration event is firing.
    Can somebody pls explain why this is happening and also i want to pay the employee only till the termination date of the employee. Can someone tell me if i need to set the termination rule to actual termination date?
    Regards,
    Gayatri

    When you set an element with the termination rule as Last Standard Process the 'end date' of the element is set to the last day of the month when the employee gets terminated. This is why the Pro-ration event group doesnt fire.
    You can add the following datetracked events in your proration group and make necessary changes in your fast formula.
    Datetrack Update - PER_ALL_ASSIGNMENTS_F - ASSIGNMENT_STATUS_TYPE_ID
    HTH

  • Urgent: Pagination event

    Hi all !
    I'm searching for a possibility to handle the click event for the next or previous link of a pagination.
    Exactly I want to reset an item, but only when the user clicks on next or previous.
    Any ideas how to solve this problem?
    Thx
    Michal

    Just had a quick look at this. In the 'Layout and Pagination' section you can use 'Externally Created Pagination Buttons.'
    By looking at what link the automatic ones are building, and incorporating the clear cache URL syntax you might be able to cobble something together.
    Someone might come along with a better solution though - the request might be set to some parameter than you can make a process conditional on, but I'm not sure what that might be.

  • JTree Events

    Hi

    class HiKalyani{
         public static void main(String[] args){
              System.out.printf("%s\n", "Hi Kalyani! ^_^");
              throw new RuntimeException("http://forum.java.sun.com/thread.jspa?threadID=629779&tstart=0");
    }

  • Very urgent-Jtree+JTabbedPane

    hi,
    I have a tree on the left hand which has a popupmenu.On selection of the menuitem it should make a tabpane visible on the right side. The problem with this is that i have a tabbedpane.java file which already has some more tabpanes and i have tree.java file and i have tried various things in order to make the tab pane enable with the item.
    Here is the list of things i tried.
    firstly i initialized the tabbedpane constructor in the tree.java file and then called a method in the tabbedpane.java file per say tabpane()
    Later in the tabbedpane.java file i set the method tabpane().
    Here i tried using
    .setSelectedIndex(int,boolean)
    .setEnableAt(int)
    .insertTab(String,Icon,Component,String,int)
    any guideline will really be appreciated
    Thanks in advance

    No that doen't work as, at the node selection a popup menu occurs and only on clicking on one of the menuitems should the tab pane be inserted. Thus using tree selection listener doesn't as i tried using it.
    Hope this helps else i'll write a sample code and send you.
    Thanks again

  • How to create event alert for particular column get updated

    Hi every one.... plz help me
    How to create oracle event alert when particular column is update. plz help me.... Acutually i need email alert when ever list price for an item column in pricing table get updated+... plz. Its urgent.

    Oracle Event alert is based on update of specific table and not on specific column in table.
    However you can create a trgigger on table which is based on updat of column. And in this trigger you can send a mail using plsql.
    HTH

  • Inconsistent results for adding child node in a JTree

    I have a JTree where I add child nodes when a user clicks on the node or handle. When the user clicks on the node, through implementing TreeSelectionListener interface, I add a node, the tree expands, and I see the newly added node. However, when the user clicks on the handle, through implementing the TreeExpansionListener, the tree does not expand and I do not see the newly added node. The problem is repeatable by compiling the code below.
    Why is there this difference? Aren't all the methods implemented through the TreeSelectionListener and TreeExpansionListener in the SWT thread?
    public class TestFrame extends JFrame implements TreeSelectionListener, TreeExpansionListener {
         public TestFrame() {
              String[] alphabets = {
                        "a", "b", "c", "d", "e", "f", "g",
                        "h", "i", "j", "k", "l", "m", "n",
                        "o", "p", "q", "r", "s", "t", "u",
                        "v", "w", "x", "y", "z"
              DefaultMutableTreeNode top = new DefaultMutableTreeNode("CEDICT");
              for(int i=0; i < alphabets.length; i++) {
                   DefaultMutableTreeNode node =
                        new DefaultMutableTreeNode(alphabets) {
                        public boolean isLeaf() { return false; }
                   top.add(node);
              JTree tree = new JTree(top);
              tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
              tree.addTreeSelectionListener(this);
              tree.addTreeExpansionListener(this);
              tree.setShowsRootHandles(true);
              JScrollPane treePane = new JScrollPane(tree);
              treePane.setHorizontalScrollBarPolicy(
                        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
              treePane.setVerticalScrollBarPolicy(
                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
              treePane.setSize(new Dimension(200,400));
              treePane.setPreferredSize(new Dimension(200,400));
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(treePane, BorderLayout.CENTER);
              Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              int inset = 50;
    setBounds(inset, inset,
    screenSize.width - inset*2,
    screenSize.height - inset*2);
              setLocationRelativeTo(null);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              pack();
              show();
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        JFrame.setDefaultLookAndFeelDecorated(true);
                        TestFrame frame = new TestFrame();
         public void valueChanged(TreeSelectionEvent e) {
              JTree tree = (JTree)e.getSource();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
         public void treeCollapsed(TreeExpansionEvent event) {
              JTree tree = (JTree)event.getSource();
              TreePath path = event.getPath();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) path.getLastPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
              tree.invalidate(); //does not help to show newly added child
         public void treeExpanded(TreeExpansionEvent event) {
              JTree tree = (JTree)event.getSource();
              TreePath path = event.getPath();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) path.getLastPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
              tree.invalidate(); //does not help to show newly added child

    I couldn't figure out why inserting a node in the valueChanged(...) method works. In all three methods no listeners are notified about the change, so you would think all three would fail.
    For a JTree using the DefaultTreeModel the nodesWereInserted(...) method needs to be called. For example, if I change your last three methods to this
    public void valueChanged(TreeSelectionEvent e) {
       insertNode((JTree) e.getSource(),
                  (MutableTreeNode) e.getPath().getLastPathComponent());
    public void treeCollapsed(TreeExpansionEvent event) {
       insertNode((JTree) event.getSource(),
                  (MutableTreeNode) event.getPath().getLastPathComponent());
    public void treeExpanded(final TreeExpansionEvent event) {
       insertNode((JTree) event.getSource(),
                  (MutableTreeNode) event.getPath().getLastPathComponent());
    public void insertNode(JTree tree, MutableTreeNode parent) {
        Date date = new Date();
        MutableTreeNode child = new DefaultMutableTreeNode(date.toString());
        int index = parent.getChildCount();
        parent.insert(child,index);
        ((DefaultTreeModel) tree.getModel())
                .nodesWereInserted(parent,new int[]{index});
    }then it works as you desire. You can (and should) of course use the DefaultTreeModel's own insert method.
    DefaultTreeModel#insertNodeInto(MutableTreeNode,MutableTreeNode, int)

Maybe you are looking for

  • How do I find all of one color in a line drawing and replace it with another color?

    Greetings, I'd like to replace this goat-puke green color with "black." I have tried everything, but can't find the right command. I'm sure that nothing could be easier, but I'm stumped and will probably smack myself in the head when I see the answer

  • Basic Invoicing Question

    Hello SD Gurus, I have a basic question about customer invoice. I have been in sales for about five years but new to SAP. I was reading through some documentation on how to post invoices. But the way I have always seen it done in an organization is e

  • Ethernet adapter/wireless repeater and iPhone 4

    Hi everybody, It would be nice if you could help me with a problem I'm having. I'm going to stay two weeks overseas in a place where there's no wifi connection (just the ethernet) and I'm going to bring just my iPhone. The best solution I got until n

  • Planned and actual consumption for each confirmation

    Dear All, There is a production order. it has two operations. i have made three confirmations of each operation for that order. now i want to see the planned and actual consumption for each confirmation. how is it possible. However i know that on ord

  • Error in wip calculation

    Dear gurus, While diong wip calculation system is giving error +There are values for cost element 50000000 that are not assigned to any line ID**Message no. KJ161+ Diagnosis Not all values for the cost element are assigned to a line ID. Procedure Ass