TreeTable in Matlab 2025a

조회 수: 7 (최근 30일)
Etienne Balmes
Etienne Balmes 2025년 8월 29일
편집: dpb 2025년 9월 10일
Since javacomponents are deprecated as of MATLAB 2025a, has anyone found a way to generate treetables similar to what was possible with jide ?
We have been relying on those for a lot of GUI and see nothing in UITABLE/UITREE that would be similar. Necessary features are
  • tree opening
  • resizable columns
  • cell renderer allowing push buttons and pull down menus
  • column sorting is a bonus
  댓글 수: 5
dpb
dpb 2025년 8월 31일
편집: dpb 2025년 8월 31일
The above link didn't quite work , maybe https://www.ag-grid.com/javascript-data-grid/getting-started/ is example component...
It would seem the short tem solution for all would be for Mathworks to reverse the decision to pull Swing until whatever is the longterm replacement does have at least equivalent functionality.
It's bound to be extremely frustrating given a 5-year history of the functionality need for them to then have gone ahead and made the unilateral decision to pull the existing functionality. One would hope TMW will listen to the support request and provide a workaround if not entirely reverse the course of the leviathan.
Cris LaPierre
Cris LaPierre 2025년 9월 10일
편집: dpb 2025년 9월 10일
To that end, please submit the feedback directly to MathWorks if you have [not sic--dpb] done so already.

댓글을 달려면 로그인하십시오.

답변 (1개)

Samayochita
Samayochita 2025년 9월 2일
편집: Samayochita 2025년 9월 2일
Hi Etienne,
I understand that you are trying to generate treetables in MATLAB. Unfortunately, there is no built-in treetable component available but here is a high-level view of how you could implement treetable by using “uitree” and “uitable” and synchronizing their events so that expanding or collapsing nodes dynamically updates the table rows.
1. Build the UI layout
  • Use “uifigure” followed by “uigridlayout” with two columns. Column 1 will contain “uitree” for hierarchy. Column 2 will contain the “uitable” for data.
  • This makes them look like one component aligned row by row.
2. Define the tree data: Represent the hierarchical data as a nested structure.
3. Handling expand/collapse logic:
  • Attach “NodeExpandedFcn” and “NodeCollapsedFcn” callback to the “uitree”. Inside these callbacks, recompute which nodes are visible and refresh the “uitable” accordingly.
  • This makes the table row count increase or decrease dynamically when tree nodes are toggled.
4. Flattening helper function
  • Write a recursive function to convert hierarchical nodes into a flat array of rows.
  • For every expanded node, add a row to the table.
Note:
  • “uitable” in App Designer supports interactive column resizing by default.
  • Drop-down menus in “uitable” are supported using the 'ColumnFormat' property.
  • There is no direct way to put a push button into a “uitable”. You might be able to do it with Java, but the only component that “uitable” supports is checkbox.
Some links for your reference:
Hope this was helpful.
  댓글 수: 6
Etienne Balmes
Etienne Balmes 2025년 9월 4일
Please note that I will continue editing my answer as to why I can't accept @Samayochita answer in the first comment which tends to be hidden. https://fr.mathworks.com/matlabcentral/answers/2179688-treetable-in-matlab-2025a#comment_3340351
dpb
dpb 2025년 9월 4일
It's got to be tough to support a major app given the dynamic nature of MATLAB and particularly with the reinvention of things and the shift in implementation toolsets. While some at least is understandable owing to external changes, it can't be easy when new doesn't match old and particularly when there is actual loss of functionality rather than just a recoding of a different widget but that at least can do the same thing.
You have my sympathy for what little that's worth <vbg> and good luck in finding a way forward.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by