Jtree expand all not working

I have a very large jtree, that at it second level gets loaded from a JDOm file.
The problem is I am having a problem expanding all the nodes under a
particular node. I need an expandAll method. Nothing I have tried has
expanded beyond the child level.
After a few permutations my code right now is
public void expandAll(DefaultMutableTreeNode node)
Enumeration list = node.breadthFirstenumeraion();
while (list.hasMoreElements())
TreePath treePath = new
TreePath(((DefaultMutableTreeNode)list.nextElement()).getPath()))
tree_m.expandPath(treePath);
Am i missing something about expandPath?
I even use the code from JTree example to the reload the model.
But it still only shows the nodes children, not the children's children....etc.

Hi!
You can try these methods where treeRoot is the root node of the tree:
* Collapses the function group tree.
public void collapseAll() {
for (int i = treeRoot.getChildCount(); i > 0; i--) {
tree.collapseRow(i);
* Collapses the function group tree.
public void expandAll() {
for (int i = treeRoot.getChildCount(); i > 0; i--) {
tree.expandRow(i);
/Malin

Similar Messages

  • Expand all not working for me

    I have no clue on this and it sucks. Can anybody tell me why
    my expandAll() call does not work. It does not expand the nodes.
    Here is my code. The ADG is created in actionscript and then
    grouping is applied to create hierarchical data. The last three
    lines of the following code are where I call expandAll... after
    validateNow too.
    [CODE]var oneColumn:AdvancedDataGridColumn = new
    AdvancedDataGridColumn("FRONTS: ("+firstsFronts.length+")");
    var twoColumn:AdvancedDataGridColumn = new
    AdvancedDataGridColumn("#");
    var threeColumn:AdvancedDataGridColumn = new
    AdvancedDataGridColumn("%");
    oneColumn.width = 120;
    twoColumn.width = 35;
    threeColumn.width = 45;
    oneColumn.sortable = false;
    twoColumn.sortable = false;
    threeColumn.sortable = false;
    oneColumn.dataField = "FRONT";
    twoColumn.dataField = "theCount";
    threeColumn.dataField = "thePercentage";
    //twoColumn.width = 20;
    indPersonnelDataGridFronts.columns =
    [oneColumn,twoColumn,threeColumn];
    var groupingColl:GroupingCollection = new
    GroupingCollection();
    var groupingGroup:Grouping = new Grouping();
    groupingColl.source = firstsFronts;
    var myFieldGroup:GroupingField = new GroupingField("FRONT");
    groupingGroup.fields = [myFieldGroup];
    groupingColl.grouping = groupingGroup;
    var sr:SummaryRow = new SummaryRow();
    var sf:SummaryField = new SummaryField();
    sf.dataField = "FRONT";
    sf.operation = "COUNT";
    sf.label = "theCount";
    sr.fields = [sf];
    sr.summaryPlacement = "group";
    //myFieldGroup.summaries = [sr];
    var srP:SummaryRow = new SummaryRow();
    var sfP:SummaryField = new SummaryField();
    sfP.dataField = "FRONT";
    sfP.summaryFunction = calcPercentage;
    sfP.operation = "COUNT";
    sfP.label = "thePercentage";
    srP.fields = [sfP];
    srP.summaryPlacement = "group";
    myFieldGroup.summaries = [sr, srP];
    groupingColl.refresh();
    indPersonnelDataGridFronts.dataProvider = groupingColl;
    indPersonnelDataGridFronts.validateNow();
    indPersonnelDataGridFronts.expandAll();[/CODE]

    Thank You Barbara.  I knew it was operator error.
    David
    On Fri, Oct 10, 2014 at 6:10 PM, Barbara B. <[email protected]>

  • OS X 10.6.6-gestures for pinch to zoom or expand do not work.

    Just installed Firefox 4 RC 1 and noticed that the pinch to open or close (zoom/expand) do not work. I can use other gestures (like swiping three fingers to move back or forward, but no luck with the pinch to zoom or expand. Keyboard shortcuts for this function work fine (command +/-).

    Funcionó para mi
    It worked for me

  • URGENT: Sorry, Expander will not work without the Stuffit Engine...

    hallo,
    I want to watch a show of myself on Time Warner Cable TODAY live ONLINE while being in Europe, so it is urgent:
    sometimes when I try to install a software I get the following error message:
    'Sorry, Expander will not work without the Stuffit Engine. Please reinstall the original installer.'
    Just now I wanted to install 'Windows Media Player 9 for Mac OS X' and got that error message. Any suggestions?
    THANKS YOU!
    1 GHz PowerPC G4 (3.3)   Mac OS X (10.4.7)  

    "Any suggestions? "
    Obviously you need to reinstall Stuffit Expander. Download it from Stuffit.com.
    Also, forget about Windows Media Player. It's out dated, and not even made anymore. Download the free Flip4Mac QuickTime plugin from Flip4Mac.com
    Hope that was urgent enough...

  • TS3219 I have an ipad 3 that has wifi and for some reason my youtube, facebook, and app store app are all not working. How do i fix this?!!!

    I have an ipad 3 that has wifi and for some reason my youtube, facebook, and app store app are all not working. How do i fix this?!!!

    Hey there FlamingTurd!
    If you are having issues connecting to the App Store on your phone, there is an article here that can help you troubleshoot this issue a little further:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    We also have an article that deals with troubleshooting apps you have downloaded from the App Store and installed on your computer. That article can be found here:
    iOS: Troubleshooting applications purchased from the App Store
    http://support.apple.com/kb/ts1702
    Finally, if neither of those articles resolve the issue, you may need to restore your iPad:
    iTunes: Restoring iOS software
    http://support.apple.com/kb/ht1414
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • Post RH 9 Upgrade Expand All and Collapse All not working.

    After upgrading to RoboHelp 9 from 7 - the Collapse All and Expand All is not working.  I am taking over after attending a RoboHelp 9 Training Class a little over a week ago, so any help would be appreciated.

    Hi,
    What is your output? Where are the show/hide buttons placed: In the topic or in the toolbar? You're using RoboHTML right?
    Did you use any kind of twisties in your RoboHelp 7 project? The show all hide all buttons are controlled by a custom script and I'd like to know which method you are using. (If you know which.) See also http://www.grainge.org/pages/authoring/twisty/twisty.htm
    If you're not sure which method you are using, can you post the HTML of the show/hide all button/link?
    Greet,
    Willam

  • Af:tree control expand is not working

    Hi all ,
    af:tree control expansion is not working if I click on the + sign. But it is working thru context menu "Expand All Below" option.
    Can any one help me.
    Thanks
    Kristi
    Message was edited by:
    Kristi(user576892)

    Hi,
    not with this little information
    - which technology
    - which browser version (if applicable)
    - how to reproduce
    - does it reproduce on other machines / browsers
    Frank

  • Help! Youcam, Microsoft Word, Excel, Powerpoint and Adobe Reader all not working in U310

    Using a U310 ideapad with Windows 7 bought one year ago - warranty just expired of course!!
    5 days ago I tried to pull up and excel spreadsheet from an e-mail and got an error message that there was not enough memory to do so.
    Afterward, I tried to open word and it simply grayed out with a message box saying it was not working - it would try to fix the problem and then it just disappeared.  The same thing continues to happen.
    I tried to open a PDF with Adobe Reader and it, too, crashed.  I uninstalled it and reinstalled it, stopped it from coming up in protected mode and now it doesn't crash but I cannot edit any pdf with it and the tools box no longer works at all - a small circle spins in it for a couple of seconds, then fades to gray.
    My youcam will not turn on at all - when I click on the youcam icon, the cursor spins for a couple of seconds,then returns to an arrow and the youcam doesn't come on.
    So, after experiencing all these things, I figured I'd try the tried-and-true method of rebooting my laptop.  When the laptop restarted, before allowing me to enter my password, the error message "verifyhost.exe - application error unable to start correctly Oxc000007b" came up.  I x'd out of that, entered password, then 2 other errors came up "lenovoreg.exe" and SACpl.exe
    After working on this for hours, I'm really at a loss as to what it could be.  Does anyone have any idea?   It's unbelievable to me that this has happened on a new laptop that basically just sits on my desk - I don't travel with it and don't do much more than email and word processing on it!  I have no games and very little else even downloaded!  

    Download this, install, update and try to scan your hdd for malware.

  • My BBM and BB Instant messaging all not working on my BB Torch 9800 Even with my Data Plan Activated!

    Device: BB Torch 9800
    Carrier: Globe Telecom (Philippines)
    OS Version: 2949 (v6.0.0.668,Platform 6.6.0.236)
    App free Space: 266.7 MB
    Device Memory free space: 3.5 GB
    Apps Installed:
    AOL IM: 2.5.78
    BBM: 6.1.0.71
    Facebook: 2.0.0.58
    Google Talk: 2.5.125
    My Space: 2.0.0.19
    Twitter: 2.1.0.28
    Windows Messenger: 2.5.125
    Yahoo Messenger: 2.5.125
    BB App World: 3.1.1.21
    Problem: I bought my Torch 9800 on a Blackberry Retailed outlet and inserted my Old Simcard on it . I enrolled on a BB data plan from my carrier (GLOBE's BB Social ON: pls refer from this link to understand better regarding my Carrier's Data plan ) I can access only on my Facebook,My space and Twitter Apps. All other such as BBM, YM,WM,AOL ang GoogleTalk are not working. For BBM: I tried to add a contact as well as my frend tried to add me but i never received the invitation nor did my friend (my friend also has the same Carrier as mine and enrolled on the same package using his BB Bold 9000 OS 5 with BBM 6.1.0.71),another friend also tried to send me BBM invite but never received it. When I tried to log-in on my YM app,it says "service not enabled for this handheld".. I tried to go to the Carrier Customer Service to help me with the settings or something and say that my account is already updated to their BB services and I have already the correct settings. I tried to delete and reinstall the apps..did countless hard resets on my phone..but still the same problem..Can Someone help me plz..

    I'm sorry to say, but I'm having the EXACT same telecom, same plan, same problem. I wonder if the original poster was able to solve his problem. I still can't use my BBM, though the other apps work just fine. :/

  • MY WINDOW 8.1 APP ALL NOT WORKING

    Dear Microsoft
    i just brought my laptop last month..the model is ACER ASPIRE E1-572G with the windows 8.1 inside..on first week after i buy the laptop all function was great...but after a week my apps not working already even Store app also not working..please help me
    to slove it..thansks 

    Hi ALENTHIEN,
    Sorry, I think you post in a wrong forum, and I will move to off-topic.
    I think the suitable forum for you is
    http://answers.microsoft.com/en-us/windows
    --James
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • Chechbox header : deselect all not working

    folks,
    I have a jtable generated from my database. IT has 3 columns . The 3rd column has checkboxes in it. I am implementing a "CHECK ALL"
    checkbox on the header for selection and deselection of checkboxes. the below code works for selection of all boxes.. IT DOES NOT
    WORK WHEN IT IS DESELECTED ? i want to make it work for deselection also
    I call the custom table renderer from main program as follows :
    tc = table.getColumnModel().getColumn(3);
    tc.setHeaderRenderer(new CustomTableCellRenderer1(new MyItemListener(),Name));
    this is item listner in main program for checkbox "check all" present in the table header :
    class MyItemListener implements ItemListener
    public void itemStateChanged(ItemEvent e) {
    Object source = e.getSource();
    if (source instanceof AbstractButton == false) return;
    boolean checked=e.getStateChange() == ItemEvent.SELECTED;
    for(int x = 0, y = table.getRowCount(); x < y; x++)
    table.setValueAt(new Boolean(checked),x,3);
    if (e.getStateChange() == ItemEvent.DESELECTED) // dosent work
    System.out.println("deselect all"); // may b code for deselection
    this is CustomTableCellRenderer1 class below:
    package moxaclient;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.event.*;
    class CustomTableCellRenderer1 extends JCheckBox
    implements TableCellRenderer, MouseListener {
    private static final long serialVersionUID = 1L;
    protected CustomTableCellRenderer1 rendererComponent;
    protected int column;
    String Name;
    private JTable table1;
    Object abc=null;
    protected boolean mousePressed = false;
    public CustomTableCellRenderer1(ItemListener itemListener,String name) {
    rendererComponent = this;
    rendererComponent.addItemListener(itemListener);
    this.Name=name;
    public Component getTableCellRendererComponent(
    JTable table, Object value,
    boolean isSelected, boolean hasFocus, int row, int column) {
    if (table != null) {
    JTableHeader header = table.getTableHeader();
    this.table1=table;
    if (header != null) {
    rendererComponent.setForeground(header.getForegrou nd());
    rendererComponent.setBackground(header.getBackgrou nd());
    rendererComponent.setFont(header.getFont());
    header.addMouseListener(rendererComponent);
    setColumn(column);
    rendererComponent.setText("Check All");
    setBorder(UIManager.getBorder("TableHeader.cellBor der"));
    return rendererComponent;
    protected void setColumn(int column) {
    this.column = column;
    public int getColumn() {
    return column;
    protected void handleClickEvent(MouseEvent e) {
    if (mousePressed) {
    mousePressed=false;
    JTableHeader header = (JTableHeader)(e.getSource());
    JTable tableView = header.getTable();
    TableColumnModel columnModel = tableView.getColumnModel();
    int viewColumn = columnModel.getColumnIndexAtX(e.getX());
    int column = tableView.convertColumnIndexToModel(viewColumn);
    if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) {
    doClick();
    int row=table1.getRowCount();
    if(row!=0)
    for(int i=0;i<=row-1;i++)
    String Sensor =(String) table1.getValueAt(i, column-3); // // when checkbox selectedthis code gets all value present in table and stores in string abc
    Double Value =(Double) table1.getValueAt(i, column-2);
    String Date =(String) table1.getValueAt(i, column-1);
    abc += Sensor+"\t"+Value+"\t"+Name+"\t"+Date+"\t";
    public void mouseClicked(MouseEvent e) {
    handleClickEvent(e);
    ((JTableHeader)e.getSource()).repaint();
    public void mousePressed(MouseEvent e) {
    mousePressed = true;
    public void mouseReleased(MouseEvent e) {
    public void mouseEntered(MouseEvent e) {
    public void mouseExited(MouseEvent e) {
    plzz help.

    please add tags around the code in your posts.
    Dinud123 wrote:
    IT DOES NOT
    WORK WHEN IT IS DESELECTED ? i want to make it work for deselection alsoI don't know any user interface where I would toggle "select all" and "deselect all" via the same control. That may be for a reason.
    So my suggestion is: provide a second button for "deselect all".
    bye
    TPD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • JTree Expand All & Collapse All...

    Hi All,
    i hv two buttons "Expand All" & "Collapse All". If i press "Expand All" i should expand all the nodes in the all the root nodes(JTree).
    If i press "Collapse All" i sh collapse all the entries in the JTree.
    Is there any way to acheive this.
    Thanks
    ss

    Hi!
    You can try these methods where treeRoot is the root node of the tree:
    * Collapses the function group tree.
    public void collapseAll() {
    for (int i = treeRoot.getChildCount(); i > 0; i--) {
    tree.collapseRow(i);
    * Collapses the function group tree.
    public void expandAll() {
    for (int i = treeRoot.getChildCount(); i > 0; i--) {
    tree.expandRow(i);
    /Malin

  • Tray Expand button not working

    Dear Expert,
    After the SPS upgrade of SP 21 for java stack, I am facing a issue of Expand button of the tray is not working for the iviews which contain dynamic information such as BI reports etc., Please help me out in this issue
    Regards
    Noel

    Hi Noel,
    The expand button / the tray UI element can be a Webdyn Pro Java Component.
    This does not have to be a iview tray.
    Are you using the BI iView in a separate Portal or are you using Portal Federation ?
    If you have 2 portals, what is the second portal version ?
    Regards,
    Kai

  • Expand/Collapse not working DataViewWebPart

    Hello,
    I'm having some difficulties with my DataViewWebPart page. The page shows the documents from a library. These documents are grouped by three collumns:
    - Klantnummer
    - InstallatieType
    - Map
    In SharePoint Designer i added these three collumns for sorting/grouping. When i choose "Expand" the whole list is expanded. But the Plus "+" and Min "-" signs are not working on my page. When i click on them the sign changes
    but nothing happends. (Collapsing works but not expanding)
    I can not expand these anymore.
    Hope you guys understand my story and know a way to fix this.

    Are you seeing any JavaScript errors?
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Safari/Youtube/iTunes/App Store All Not Working

    Hello,
    I have an iPhone 3GS and today all of the software that required the use of the internet just stopped working.
    Safari, YouTube, iTunes, and the AppStore all do not work. I click on one of these four icons, it pops up for about five seconds, then it goes right back to the home screen.
    I tried shutting off my phone. Didn't work.
    I tried reconnecting it to iTunes itself. Didn't work.
    I reset my network connections. Didn't work.
    I erased my History, Cache, and Cookies. All that did was make it so that when I click on Safari, my Bookmarks come up. The internet still doesn't work.
    A friend of mine has a theory that these "apps" aren't working because of the snow/rain/ice storm I'm currently in the middle of and that once it blows over, my internet should work again.
    My WiFi and 3G work.
    I'd like to avoid resetting my phone to it's orginal settings if that's possible.
    My most recent update is the 4.2.1 update.
    To any and all who can help or offer some suggestions, thank you very much.

    Sleuth wrote:
    I tried both resetting it by itself and while it was connected to iTunes. It didn't work.
    Thank you for your help though.
    You tried resetting all settings on the device by going to Settings > General > Reset > Reset all settings?
    There is no reset in iTunes, are you stating that you did a restore? If you did a restore, did you restore as a new device or from your backup?
    What you describe sounds like an issue in the settings of your device. If you have not already, restore as a new device.

Maybe you are looking for