Easy JTree question

I'm using something like the code below to "select" a node in my JTree. The node does get selected (an action is taken via the listener), however the node does not get selected in the graphical sense (i.e. the mouse selected node remains highlighted). How do I get the JTree to render the programatically selected node as the new selection?
  jTree.setExpandsSelectedPaths(true);
  jTree.setSelectionPath(jTreePath);
...Thanks

you could try something like this if you had all your
checkboxes named ina stuctured order I.E. checkbox_1, checkbox_2
ect.
countVar = 0;
//if you had 10 checkboxes I.E. i<11
add_btn.onPress=function(){
for(i=1; i<11; i++){
if(_root["checkbox_"+i].selected==true){
countVar+10
movieClip_mc.gotoAndPlay(countVar)
}

Similar Messages

  • Havent a clue! Please help! Easy ABAP Question!

    Helly Gurus
    I am loading from a dso to a cube and doing a lookup on a second dso.
    eg
    'Name' is in the DSO1
    I lookup 'Address' from DSO2
    Then load to the cube.
    The problem is there may be more than one address so although I have coded the lookup to
    find all addresses, I do know how to get these into my results.
    Only the first address it finds is there.
    loop at DATA_PACKAGE.
        select * from DSO1 where
        NAME = DATA_PACKAGE-NAME.
        if sy-subrc = 0.
          move-corresponding DSO2 to itab1. collect itab1.
        endif.
        endselect.
      endloop.
    What do I need to do to get all of the results?
    I am in 3.5 so do not have the use of an End Routine.
    Thanks
    Tom Tom

    you need to do several treatments in fact you need to add records on the data_package (by the way it is not an easy ABAP question as you mentioned !)
    So
    Treatment 1: select all the records from ods2 table of adresses outside the loop
        select names adresses
        from ods2
        into table g_itab_ods2
          for all entries in data_package
          where name eq data_package-name.
    Treatment 2: delete double records of the internal table.
        delete adjacent duplicates from g_itab_ods2 comparing names adresses.
    Treatment 3: loop over the data_package. Within this loop read the internal ods2 table and loop over it to assign the corresponding adresses. Then append the results to the temporary data_package_tmp and move all the records to the initial data_package.
    loop at data_package assigning <data_fields>.
       read table g_itab_ods2 into l_g_itab_ods2
          with key name = <data_fields>-name.
          if sy-subrc eq 0.
            loop at g_itab_ods2 assigning <adresses>
            where name                = <data_fields>-name.
              <data_fields>-adresses= <adresses>-adresses.
              append <data_fields> to lt_data_package_tmp.
            endloop.
          endif.
        endloop.
        data_package[] = lt_data_package_tmp[].
    free lt_data_package_tmp.
    this should do what you want to do. hope this could help you out.

  • Can't edit multiple tracks - plus 2 easy audio questions

    I have a sequence with 1 video track and 6 stereo audio tracks. I set an in and an out point. The area on the clips in the timeline between the two edit points highlights, I hit delete. Normally, the tracks between the points should disappear as the two segments come together and form one great edit.
    But all the tracks do not highlight and edit. The video track and stereo audio tracks 3+4 and 5+6 highlight and LIFT off. But audio tracks 1+2 do not highlight or edit. And the whole sequence doesn't close together where the edit should be.
    Only way I have been able to overcome this is to use the razor blade tool, cut each track individually. Highlight them all, and then hit delete.
    This didn't use to be the way. FCP used to edit through one track, 3 tracks or all tracks, no problem.
    Two audio questions. How do you stop the waveforms from drawing onto the clips in the timeline, in order to speed up FCP?
    How do you get the audio in captured clips to be a Stereo Pair, from the outset?
    Thanks to all you who help!

    Is it usual for FCP to bog down on a 4 minute piece when audio wave forms are turned on??
    <
    No. Should run fine. You get up into 6-12 audio tracks, FCP gets all moody and pouty.
    But it depends on your system's capabilities and how well you have chosen your sequence settings.
    Audio waveforms n FCP are a cruel joke compared to many other NLEs. Often easier to leave them off in the timeline, use the waveform in the Viewer and set markers for hooks in the audio tracks.
    bogiesan

  • JTree questions (1) Re-populating (2) Adding popups

    Hi all,
    I've just started to use a JTree in my application and I've encountered two
    problems. Sorry if these have been covered before - I've been Googling around
    for answers.
    I have a UI panel ...
    http://photos1.blogger.com/blogger/541/411/1600/TreeDemo.gif
    ... where a tree is populated with stock quotes from different
    sources. The user selects the stock and the tree should update to show the
    quotes for that stock. The quotes are read from a DB and I want the user to
    be able to delete from the DB using a pop-up on the leaf nodes.
    Problems
    (1) Re-populating
    The only way I've got this to work at this time is to create a new tree from scratch,
    based on the stock name, then put it into a new scroll panel, remove the old scroll
    panel from the container and add the new one. Not good is it? Nasty, nasty.
    I've read a lot about needing to interact with the tree model - is that right?
    (2) Adding popups
    I want to be able to delete items from the DB by doing a right-click on the leaf
    nodes and selecting "Delete" from the pop-up.
    I find that I can't add a mouse listener to the DefaultMutableTreeNode used to
    hold the leaf item. Should I subclass DefaultMutableTreeNode and implement some
    interface to do this?
    Any insights very much appreaciated.

    I know I'm asnwering my own question here - but I found the answer to teh re-population question while waiting.
    I now use the DynamicTree class that is included in the Sun tutorial here
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    Specifically, here
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#DynamicTreeDemo
    I'd still welcome any suggestions on the pop-up menu question!

  • Easy swing question for Java friends

    Hi could somebody test this short application and tell me why the "DRAW LINE" button doesnt draw a line as I expected?
    thank you very much!
    Circuitos.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import java.awt.geom.*;
    public class Circuitos extends JApplet {
         protected JButton btnRect;
         protected Terreno terreno;
         private boolean inAnApplet = true;
         //Hack to avoid ugly message about system event access check.
         public Circuitos() {
              this(true);
         public Circuitos(boolean inAnApplet) {
            this.inAnApplet = inAnApplet;
              if (inAnApplet) {
                   getRootPane().putClientProperty("defeatSystemEventQueueCheck",Boolean.TRUE);
         public void init() {
              setContentPane(makeContentPane());
         public Container makeContentPane() {
              btnRect = new JButton("DRAW LINE");
          btnRect.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                terreno.pintarTramo();
              terreno = new Terreno();
              JPanel panel = new JPanel();
              panel.setLayout(new BorderLayout());
              panel.add("North",btnRect);
              panel.add("Center",terreno);
              return panel;
         public static void main(String[] args) {
            JFrame frame = new JFrame("Dise�o de Circuitos");
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              Circuitos applet = new Circuitos(false);
              frame.setContentPane(applet.makeContentPane());
              frame.pack();
              frame.setVisible(true);
    }Terreno.java:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.geom.*;
    public class Terreno extends JPanel {
         Graphics2D g2;
         public Terreno() {
              setBackground(Color.red);
              setPreferredSize(new Dimension(500,500));
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
          g2 = (Graphics2D) g;
          g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);    
         public void pintarTramo () {     
              Point2D.Double start   = new Point2D.Double(250,250);
              Point2D.Double end     = new Point2D.Double(250,285);
              g2.draw(new Line2D.Double(start,end));            
    }

    I don't think the date I became a member has anything to do with it. Yes, I signed up a year ago to ask a question or two when I didn't know anything. It wasn't until recently have I started to use this forum again, only to try and help people as well as ask my questions. It took me a year to get to this point to where I can actually answer questions instead of just asking. So don't be silly and judge a person based on their profile.
    Secondly, I agree with you, the search utility is great. I use it all the time and usually I'll find my answers, but if I don't is it such a pain in the butt for you to see the same problem posted again?? I know how much you want people to use the resources available before wasting forum space with duplicate questions, but it's not going to happen. Some people are not as patient and you being a butt about it won't stop it.
    My point in general is that there are nice ways to help people and even rude ways, and your comments at times come across rude to me, even condescending. You have a lot of knowledge, therefore certain things seem trivial to you... but try to understand where some of the new people are coming from. The Swing tutorial is extremely helpful but if you don't understand the concept of programming or java that well... then it can be overwhelming and you don't know where to start. It's a huge tutorial and when people are stuck they just want an answer to their one question. Most figure it's easier to ask someone who already knows instead of reading an entire tutorial to get their answer.
    I've learned by both methods, by taking the time to research it myself and by asking a lot of questions. I have the time. Some don't. Please realize that not everyone is like you and they will continue to ask whether you like it or not. You have a choice, either help them or not.

  • Easy Slide Question for Website

    Easy question for u guys.
    What is the easiest way to create slider header such as these websites ->
    http://www.pclsolutions.com/
    http://www.alivre.com/
    What is the easies way of doing it???
    Dreamweaver has so many options, and I have very limited time so I was wondering if anybody could give me the easy answer here so I can proceed further.
    Thank you in advance guys.

    Log-in to the Adobe Widget Exchange and grab Spry Content Slideshow
    http://labs.adobe.com/technologies/widgetbrowser/
    WOW slider
    http://wowslider.com/
    NIVO slider
    http://nivo.dev7studios.com/
    just to name a few...
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com/

  • Easy runtime question

    So I bind a variable in an ActionScript and store a value at
    compile time. Now I want to update that var at runtime, say
    calculate a meal.

    I had the following Java versions listed on one computer and one of them would not uninstall, so I am wondering how much of a problem that might be for the end user.
    Java 2 Runtime Environment, SE v1.4.2_03
    Java(TM) 6 Update 3
    J2SE Runtime Environment 5.0 Update 6
    Java 2 Runtime Environment Standard Edition v1.3.1_15 (this one is "stuck" within "Add/Remove Programs" listing)
    After removing all of the above Programs and rebooting the computer I installed "jre-6u7-windows-i586-p.exe" which translates as "Java(TM) 6 Update 7" (137.00 MB) for us simple humans to read.
    Suggestions:
    It would be great if the naming conventions of these programs made a little more sense or if the Downloads area of the Java web site had a Frequently Asked Question (FAQ) prominently featured at the top of the page explaining the history of these versions. I have been supporting the installation of these Plug-ins or Programs for several years and feel it has not gotten any easier with regards to names.
    It might even be nice to see a Timeline of versions showing:
    Java(TM) 6 Update 3, Released January 2008
    Java(TM) 6 Update 7, Released October 2008
    This would allow people using specific pieces of older software, as mentioned above, to have some idea of whether the version of Java they find on their machine is the appropriate version for some in-house application that was written and released in December 2007 (for example).
    If a web-based office application I use was written in February of 2008 then I might feel confident "Java(TM) 6 Update 3" is the right version for me!
    If this is confusing for me as an I.T. support professional, I can only imagine how the End Users view these cryptic file names!
    ~
    Edited by: Klaatu01 on Mar 9, 2009 9:49 AM
    Edited by: Klaatu01 on Mar 9, 2009 9:53 AM

  • Confused -  jTree Questions

    Hi
    I have looked through the forum and other articles for answers to my questions but I am still confused.
    In my SWING application I have a JTree which has Node Type binding on it and displays nodes corresponding to Master and Detail views.
    What is the best way to capture the value of selected Node that is after a button is clicked?
    Secondly what is the best way to create an empty unbinded JTree (When i try to add a JTree the default nodes such as colors, sports etc show up)?
    What is the best way to populate this JTree? (The new JTree will be populated using the selected values from the first JTree after a button is clicked.)
    Any help will be apreciated. I have no clue where to proceed.
    Thanks in advance

    See:
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    Frank

  • "Easy Setup" Question:   best setting?

    Howdy. I'm creating video with my HD Kodak Zi6 and the output looks a bit squished. (I'm fatter than usual.)
    I've had this trouble before and suspect that I have the wrong setting checked in Easy Set Up.
    What do you folks recommend?
    Thanks.
    Brad in Denver

    Hey Tom, I've been reading a lot of your posts on this forum advising not to get the Zi6 if you want to edit in FCE, but I bought the camera before I found them. I was meaning to ask why this is a bad camera to use, because I've been able to open and edit footage in FCE as well. By going to File > import. I used the easy setup:
    Format - HD, Rate - 29.97, Use -HDV-Apple Intermediate Codec 720p30
    Here is a link to a few clips thrown together with some transitions. I don't really know what I'm doing, so, it's terrible. (You've been warned)
    http://www.vimeo.com/3956558
    I'm really thinking about returning this camera though if it is terrible to pair with FCE, because the only reason I got it was to start learning FCE. I only have 2 days left to return it though. So I need to figure it out real quick. Do you think I should pay the restocking fee and get a cheap used DV camera off amazon/ebay etc?
    Appreciate all your help and posts.

  • Easy DMS Questions

    1. When Creating a DIR thru EDMS,  must it be assigned a number using a defined number range?, Can it not be an External and determined by user?
    2. Folder Numbers (Same ? as above)

    Hi John,
    generally it is recommended that documents in EasyDMS allow the usage of internal numbers. That means for the document type used in EasyDMS in internal number range should be maintained in transaction DC10.
    The usage of external number could be useful for folders and is required for the 2 standard EasyDMS folders:
    private: <userID>
    public: EDIPUBLICROOTFOLDER
    Here the number is assigned externally. For other documents and folders you can also use external numbering during the creation process if you navigate to the tab "Technical Details". Here you can enter a document number as well but this is not that easy when using Drag&Drop function for example.
    Best regards,
    Christoph

  • Easy Reports Questions

    Hi all,
    Platform Windows NT/2000, Reports 2.5
    I have to print the report to a file. The thing is that my report is very wide. It contains a lot of fields, and I want them all in one line, because ultimately it will be read in excel.
    Now i set the MODE to "CHARACTER", and it prints to a file, fine. But when I increase the width of the page, it allows me to set the fields where I want them to, and when I run the report it shows fine in the screen but when printed to the file, it wraps into the other line.
    Please guide my what to do.
    Regards
    naveen

    Hi,
    Actually the question on this topic is posted before
    2 years then also i am giving the solutions for some
    other members having the same problem.
    You have to search for the file DFLT.PRT and
    open this file in the Text Editor (Notepad).
    Change the settings of the width from 80 to the
    width you actually needed in the report output
    (Say 350). Save the file.
    And run the report and make the text file.
    You will see the problem solved.
    Regards
    Abhijit

  • Basic easy noob question - best way of getting string from slider value

    Hi all
    I'm using a slider in my iPhone app to allow the user to select the number of days on a scale 1 - 10 for example.
    I've got the following which isn't quite working and after battling for hours and hours to get my head around UINavigationControllers I really can't be bothered anymore. Can someone please just give me the answer
    I want to get an int value from the slider which returns a float. here's my code I have (which again, isn't working correctly).
    -(IBAction)numberofDaysSliderMoved:(id)sender {
    NSNumber *theValue = [NSNumber numberWithFloat:numberofDaysSlider.value];
    [myLabel setText:[numberFormatter stringFromNumber:theValue]];
    I know it's crap code and i've probably coded the long way round but i'm just trying to get it working and i'm new to obj-C so please bare with me.
    Regards
    Wayne

    First off - you can wrap your code here like this:
    my code here
    <-- no slash
    Here you go:
    NSNumber *sliderValue = [NSNumber numberWithFloat:numberofDaysSlider.value];
    int intValue = [sliderValue intValue];
    NSString *stringValue = [sliderValue stringValue];
    Have a look as the NSNumber docs. Lots of easy ways to create and convert numbers.
    HTH

  • JTree questions

    Hi!
    What is the "best practise" on trees:
    Where should you put the methods for adding / deleting / Changes nodes? (In the node-class itself?)
    Where should you put listeners?
    How is a tree painted in the fastest way when you have many nodes?
    Thanks in advance!

    Hello ekren
    Where should you put the methods for adding / deleting / Changes nodes? (In the node-class itself?)Don't add or remove subnodes in the parentnode directly ! Use the methods from den DefaultTreeModel, or you will have problems with the GUI (JTree).
    Where should you put listeners?This depends, what you want to do. The TreeModel for model-Events, the JTree for user-events. So what do you want to do ?
    How is a tree painted in the fastest way when you have many nodes?When you have a custom TreeCellRenderer, then pay attention to your code, because the "getTreeCellRendererComponent"-method is called very often !
    Cache resources, if needed, and don't perform time-expensive tasks !
    Hope it helps
    Freddy

  • Easy newbie question re; Address Book

    I am trying to add a keyword in the Note field of each person to whom I want to send a Xmas card. I hit "edit" and then I cannot use my mouse to go immediately to the "note" field. It stays in the "first name" field unless I use the tab key to go down one-by-one.
    How to quickly access the "note" field?
    Thanks in advance for any help with this! (I bet this one has a "duh" type answer.)
    edited: I was clicking on the word "note" instead of inside the empty area. Sorry for the stupidity of the question. Duh!
    Message was edited by: MarieBoyer

    Hi Marie,
    why not create a group in Address Book (hit the '+' symbol in the bottom left hand corner)? Call it 'Christmas cards' and then drag the applicable contacts into this list. Don't worry as they not duplicated but just referenced from the total list of contacts. You could make 'sent' and 'received' lists if you wanted.
    Seasons greetings!
    Steffan

  • Probably Easy XSD Question

    I wrote the 2 files below (1 xml and 1 xsd). I think the XSD is correct but I'm pretty sure I'm not linking the XML to the XSD correctly. I think this because I can delete a line from the XML file that the XSD says is required and still view the XML file in an IE6 browser without getting an error message. So, 2 questions. 1) is my check (bringing the xml file up in an IE6 browser) an acceptable check? 2) How do I link these 2 files together so the XSD actually does check the XML file. I took a guess at it from some examples I found online but I know I'm almost certain I'm not doing it correctly.
    myXML.xml
    <?xml version="1.0"?>
    <teamList xmlns="http://www.w3schools.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.kevin.com myXSD.xsd">
         <sport id="nhl">
              <team>
                   <name>NY Rangers</name>
                   <record>
                        <wins>35</wins>
                        <losses>47</losses>
                   </record>
              </team>
              <team>
                   <name>NJ Devils</name>
                   <record>
                        <wins>50</wins>
                        <losses>32</losses>
                   </record>
              </team>
         </sport>
         <sport id="mlb">
              <team>
                   <name>NY Mets</name>
                   <record>
                        <wins>81</wins>
                        <losses>81</losses>
                   </record>
              </team>
              <team>
                   <name>NY Yankess</name>
                   <record>
                        <wins>100</wins>
                        <losses>62</losses>
                   </record>
              </team>
         </sport>
    </teamList>------------------------------------------
    myXSD.xsd
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         targetNamespace="http://www.kevin.com"
         xmlns="http://www.w3schools.com"
         elementFormDefault="qualified">
         <xs:element name="teamList" type="teamListType" />
    </xs:schema>
    <xs:complexType name="teamListType">
         <xs:sequence>
              <xs:element name="sport" type="sportType" />
         </xs:sequence>
    </xs:complexType>
    <xs:complexType name="sportType">
         <xs:sequence>
              <xs:element name="team" type="teamType"/>
         </xs:sequence>
    </xs:complexType>
    <xs:complexType name="teamType">
         <xs:sequence>
              <xs:element name="name" />
              <xs:element name="record" type="recordType"/>
         </xs:sequence>
    </xs:complexType>
    <xs:complexType name="recordType">
         <xs:sequence>
              <xs:element name="wins" type="xs:numeric"/>
              <xs:element name="losses" type="xs:numeric"/>
         </xs:sequence>
    </xs:complexType>

    Set the default namespace the same as the targetNamespace.
    <teamList xmlns="http://www.kevin.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.kevin.com myXSD.xsd">
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         targetNamespace="http://www.kevin.com"
         elementFormDefault="qualified">
    thanks,
    Deepak

Maybe you are looking for