How do I highlight JTree selection ?

Hi,
How do you highlight the selected node in a JTree from code ?
I am deleting a node and want to highlight the preceeding node. I select it via this code :-
jTree.setSelectionPath( newSelectedPath);
jTree.scrollPathToVisible( newSelectedPath);
jTree.repaint();
But that does not highlight the node.
Many thanks in advance,
Aaron

With the Move tool selected, this seems to be the only way to enlarge a selection.
What I'd want to do in Joshua's situation though is to draw a marquee around the clips I want to select. The inability to hold down shift or control and draw a second marquee to add more clips to a selection seems like a flaw! Is there a key combination or do I have to always select individual clips (or groups) after the initial selection?

Similar Messages

  • IMac desktop using OS X Lion How can I highlight a selected text in an email?

    iMac desktop using OS X Lion
    How can I highlight a selected text in an email? 

    Send the table as an attachment, either a spreadsheet (if the recipient needs to be able to edit it) or a PDF.

  • Af:tree - how do I highlight the selected tree node?

    af:tree
    I checked the generated CSS file. I found that when a tree node is selected, the related CSS attribute is:
    .xj:link{
    font-family:Arial,Helvetica,Geneva,sans-serif;
    font-size:10pt;
    font-weight:normal;
    color:#663300
    I created a customized CSS attribute, but then all of the links have the customized CSS attributes.
    How do I just highlight the selected tree node link?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    try doing the onclick javascript method
    you have to place it on the node element and id must be made dynamic
    for this use 'this.id'
    by which the current id of the node is passed
    and by capturing the id name in a var
    use the same for invoking its selected property and make it true
    like this
    var currentid = this.id;
    this.form.currentid.selected = true;

  • Highlight Current/selected cell in Calender

    Hi,
    How can I highlight current / Selected Cell in Calender ?
    Im using calender with link as like in Denes application: http://htmldb.oracle.com/pls/otn/f?p=31517:40
    But I cannot highlight the clicked/selected cell.
    Regards,
    Benz

    Any clue ? ..

  • How could i get the selected node in the JTree

    getLastSelectedPathComponent() �returns the parent node of currenr selected, so how could I get the selected node itself in the JTree
    I will appretiate for any help!

    i think you can get by....
    TreePath treePath = tree.getSelectionPath();
    DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();

  • Clicking on TOC Item Jumps to Previous Identical Entry. How to highlight the selected one?

    Win 7, 64 bit
    RH 9 (latest patch)
    HtmlHelp (CHM) output
    I have many TOC pages that are identical.
    For example, in our software some toolbar icons are repeated on different screens. In the built CHM help, if I click on a later identical page reference in our TOC, the TOC automatically jumps focus to the first entry. It doesn't stay on the selected entry.
    This causes confusion as all of a sudden the user is in an entirely different context. How can I get it to highlight the selected item and not jump to the first reference?

    Hi Jared
    Note that this issue is generically related to any help system and isn't a "RoboHelp specific thing". When multiple points in a Table of Contents reference the same page, how is the system supposed to determine exactly which TOC node is the correct one?
    The way past this is to create multiple distinct nodes from the TOC to the topic.
    One way involves never creating an actual link from the TOC to the topic. Instead, create as many distinct topics as you need in the TOC and have them redirect to the desired topic. The bottom line is that the correct page is presented and the correct TOC node is highlighted.
    Another way involves a similar approach. Create distinct topics that simply present an inline frame (IFRAME) that has the single "real" topic.
    Yet another way involves another variation. Create a Snippet that is essentially the single entire topic. Then create distinct topics that only contain the snippet.
    Hope this helps... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • How do I highlight selected text in the Pages, Keynotes?

    How do I highlight selected text in the Pages, Keynotes?

    To answer your question foor your iOS Device using Pages or Keynote for iOS: You can't highlight as you might in many note taking apps for iPad, etc.
    The best you can do at this point is to change the selected text's color by selecting the text > Style Menu (wrench) > Tap on the Font > Tap on the Color Box to reveal choices.
    If you would like to join the chorus of folks wishing such a feature were in Pages and Keynote, you can leave feedback for the people at Apple:
    http://www.apple.com/feedback/

  • How to highlight the selected value in a table

    Hi All,
    I have list of roles in a table like admin,dba...etc.
    i will select the current selected role using
      Stgin role =wdCotext.currentElement().getRole();
    After getting the role i bind this value in context.
    now my requiremnet is i will navigate to other table view containing all roles like admin,dba,networkadmin .
    I have to highlight the selected role in previous table to new table containing the  all the roles.
    means selected role should be highlight in a next table view list of roles.
    please help.

    Hi mohammad,
    To achieve this functionality, use another integer variable to store the index of the currently selected element in the first view. Pass this variable's value to the next view (either as plug parameter or throgh mapping) and set the Lead selection for the table as this index in the second view.
    In the first View ....
    int n = wdContext.current<your_node>Element().index()
    pass this value from first view to second view.
    In the second view
    wdContext.node<your_node>().setLeadSelection(n)
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

  • How to make a listbox selected item highlight color from code the same as if user click on item?

    Hi all,
    I have a listbox that gets filled with data when my program starts. I save the last selectedItem value so I set it when the program start again. But the color that the selected item has is not the same as if the user click on it (pictures below).
    The color when I set the selectedIndex=someItem is black on light grey (background)
    The color when the user clicks on the item is white on blue (background)
    Any way to make them both white on blue (background)?
    Thanks
    This is the user clicking on it:
    This is the code:

    I think the difference is focus.  When you use the mouse to select it also sets focus to the listbox so you would have to set focus to the listbox when you set the selected item.  How are you setting your selected item?  I think that by
    using a property to hold the selected item rather than setting the index that might also fix the problem.
    Lloyd Sheen

  • JTree Selection Behavior with Custom TreeCellEditor

    I've recently had the need to build a custom TreeCellEditor with a JTree that allows single path selection. I've toyed around with it but don't understand it. When a node is clicked, the editor takes over rendering/handling the cell, and a TreeSelectionEvent is fired from the tree, but the isSelected boolean value passed to the TreeCellEditor is initially false. Then on a second click of the same path in the tree, no TreeSelectionEvent is fired, but the isSelected boolean value is true. It's as if the tree selection is occuring after the editor renders the cell. I would like the cell to appear selected on the first click. Can anyone shed some light on why this is happening and how I can fix it?
    I included some code to demonstrate the problem below (though no actual editing takes place; the test code is only to demonstrate how the cells only appear selected with a yellow background after the second click of the same cell; note also that the valueChanged only executes on the first click). This test was run on Windows with Java 1.5.
    public class TestTreeCellEditor extends JLabel implements TreeCellEditor {
         private String st;
         public TestTreeCellEditor() {
              setOpaque(true);
         public Component getTreeCellEditorComponent(JTree tree, Object value,
                   boolean isSelected, boolean expanded, boolean leaf, int row) {
              this.st = value.toString();
              setBackground(isSelected? Color.YELLOW : Color.WHITE);
              setText(st);
              return this;
         public void addCellEditorListener(CellEditorListener l) {
              // not important for test
         public void cancelCellEditing() {
              this.st = null;
         public Object getCellEditorValue() {
              return st;
         public boolean isCellEditable(EventObject anEvent) {
              return true;
         public void removeCellEditorListener(CellEditorListener l) {
              // not important for test
         public boolean shouldSelectCell(EventObject anEvent) {
              return true;
         public boolean stopCellEditing() {
              return true;
    public class TestTreeCellEditorFrame extends JFrame implements TreeSelectionListener {
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        launchGUI();
         private static void launchGUI() {
              TestTreeCellEditorFrame frame = new TestTreeCellEditorFrame();
              JPanel treePanel = new JPanel();
              DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Root node");
              DefaultMutableTreeNode childNode = new DefaultMutableTreeNode("Child 1");
              rootNode.add(childNode);
              childNode = new DefaultMutableTreeNode("Child 2");
              rootNode.add(childNode);
              JTree testTree = new JTree(rootNode);
              testTree.addTreeSelectionListener(frame);
              testTree.setCellEditor(new TestTreeCellEditor());
              testTree.setEditable(true);
              testTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
              treePanel.add(testTree);
              frame.setContentPane(treePanel);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(600,400);
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
         public void valueChanged(TreeSelectionEvent event) {
              TreePath path = event.getNewLeadSelectionPath();
              if (path != null) {
                   DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
                   System.out.println("TreeSelectionEvent on " + node.getUserObject().toString());
    }

    Since my last post, I decided that I do want to be able to edit a cell that is not selected. In particular, when using a tree with checkboxes. What I'm doing for the time being, which works well enough, is to highlight the cell based on the isSelected value in combination with calling tree.stopEditing() in a TreeSelectionListener valueChanged method. This is somewhat of a hack solution, and has the side effect of a cell not appearing selected until the mouseReleased event. I'm still looking for a better solution, but for now it works well enough.

  • How do you highlight multiple documents rapidly, rather than having to click on the document and on "command" one at a time?

    How do you highlight multiple documents rapidly, rather than having to click on the document and on "command" one at a time? Right now, when I'm trying to highlight documents to export, I have to click on each document individually. Is there a way to highlight one document while scrolling down the list until all desired documents are highlighted? I would like to rapidly be able to do this to save time when I am exporting or saving multiple files from my documents to an external drive, CD-Rom or cloud storage.

    Click on the first item
    Hold the Shift key
    Click on the Last Item.
    All the items in between will be selected.

  • How do I highlight more than one thing at a time on a Mac please

    how do I highlight more than one thing at a time on a Mac please

    Do you mean items in Finder?
    To highlight (select) a whole block of items :
    - click the top item you want
    - hold down Shift
    - click the bottom item you want
    The whole range from top to bottom will be highlighted
    To select random items :
    - click the first item
    - hold down the Command key
    - click any more items anywhere in the list
    Just the items you clicked will be highlighted
    This technique works also in apps like iTunes, iPhoto, etc.

  • How can I highlight more than one song to transfer to my playlist?

    How can I highlight more than one song to transfer to my playlist?

    Standard method in OSX to select multiple items from a list:
    For blocks of items - click on first, shift click on last.
    For selecting multiple items at random - click on first command click on others.

  • How do I highlight text in the new Pages?  It's not clear.

    I have the new version of Pages.  And it appears that highlighting of text is an issue.  This is a basic function.
    I found there is one quick key version, but doesn't clearly explain how to change highlighting colours.  How to get into it.
    I have to explain this to my 80 year old mom, who we told to get a Mac because it was easier!
    So if anyone has it laid out step 1, 2, 3, that would be helpful, because it's not clear to me either.
    Thanks!
    Apple - please to a quick fix for this one, it should be the same as changing the size or the font or like bold or italic.  Simple, clear, fast and doable..... for anyone!

    TO Peter,
    Thanks for the list. I had found it in LibreOffice, tucked away in the Background tab of the Character pane opened by the Character... menu item in the Format menu, and named "Background Color. A few steps further down than in Pages. Apache OpenOffice has it in the same place. But both also have a hilight icon in the toolbar.
    I didn't fin highlighting or Color fill in Text Edit (v1.8). Might need a further search.
    But this well-equipped party of (one) oscurantist did find a shorter path to highlighting text in Pages '09, cleverly hidden in plain view! See the image below.
    TO hscortez,
    I'm aware that changing the text colour is not highlighting.
    But YeOldMacFan pointed out how to change text colour AND how to change background colour of text, using Character fill, found in the Advanced Options (Pages 5) or the More (Pages '09) tab of the Text Inspector.
    Character Fill fills the space around the character with the chosen colour. As shown above, it's essentially the same effect as dragging a hiliter pen along a line of printed text.
    Unfortunately, whats shown above is the Character fill well on the format bar of Pages '09—right out in the open like the highlighter pen button in LibreOffice, and presumeably in MS Word. I don't have Pages 5 (avoiding it until a few more of the missing features arrive), but I do note that Pages for iOS offers highlight as one of the options in the contextual menu that appears when a block of text is selcted.
    The process appears to be:
    tap twice to select some text.
    drag the handles at each end of the selection to adjust what's selected.
    tap Highlight in the menu that has appeared on the screen.
    One thing missing appears to be colour choice. The default is a 'hiliter yellow'. I didn't see a way to select a different colour.
    "Hopefully, this will make it on their upgrade list. "
    Hope is good, but taking action is useful.
    Pages menu > Provide Pages Feedback > Make your request that this be added to Pages 5. Requests made through Provide ...Feedback go directly to Apple. Comments and questions here are read by users like yourself, and we don't have the ability to change the way the apps work. Not directly,anyway.
    Regards,
    Barry

  • How can I see the selected tags in the tag bar clearly

    How can I see the selected tags in the tag bar clearly (they used to be in black, now they do not change color; a highlight or Bold would help)

    The History menu lets you revisit the page where you can drag any page element from it.
    How would you sort through thousands (tens of thousands) of files found in a cache?

Maybe you are looking for