Will uicontrols eventually be fully deprecated?

In R2020a I've found gui's made using uicontrols load much faster and, in general, seem much "snappier" than guis made using uifigures / appdesigner. While acknowledging that the appdesigner can make prettier user interfaces, I find the lack of snappiness irritating to the point that I'm still working with uicontrols almost exclusively. I've read that the relative sluggishness of appdesigner guis is something other people have experienced as well (though whether it is noticed is probably dependent on whether or not the designer is comparing to guis built with uicontrols... expectation is everything). In short:
  • Is the lack of snappiness a swing vs. javascript inevitability, or is it just the result of initial growing pains as Matlab transitions to javascript-based gui development, and the performance of uifigure guis will converge to swing-based guis?
  • Has Matlab announced anywhere if/when uicontrols will no longer be offered for gui development and old guis developed with Guide will not function or be supported?

Answers (1)

The documentation says "The uicontrol function is not supported in App Designer or in apps created using the uifigure function. Instead, for a list of available components in these contexts, see App Building Components."
It does not say anything about being deprecated (planned for removal) or that you should avoid using it. But of course that could change and they often don't publicize what their future development plans are.
I have heard about the sunset date for GUIDE but I don't know if I'm allowed to share it here (but it's fairly soon). At that date, you will not be able to create new apps with GUIDE or edit any existing GUIDE-created figures. I've told them that, for me, changing to App Designer is a deal breaker because they don't have an integrated development environment for it where you can see the command window, the source code, and variables all in the same IDE. Once/if they get that I will change to App Designer.

5 Comments

I haven't seen explicit warnings against using uicontrols, but it is hard not to infer deprecation when you see the justification behind the warning you get when using javacomponent:
figure;
javacomponent(javax.swing.JButton('Hello World'), [240,200,100,50]);
Result:
"Warning: JAVACOMPONENT will be removed in a future release. For more information see UI Alternatives for MATLAB Apps [which is a link] on mathworks.com"
If you follow the link you read:
" The undocumented JavaFrame property and javacomponent function, as well as the actxcontrol function, are capabilities that rely on third-party technologies (Java Swing and Microsoft COM, respectively), which over the years, have become legacy UI frameworks. MathWorks has been transitioning its UI building infrastructure to web technologies in response to customer requests for new web-based sharing workflows (MATLAB Web Apps and MATLAB Drive™). With this transition, maintaining support for javacomponent, JavaFrame, and actxcontrol limits our ability to further evolve the MATLAB® UI building platform to support the needs of our customers. As a result, these capabilities will be removed in a future release"
If the reasoning behind ejecting javacomponent and JavaFrame is, in part, the reliance upon Swing I have a hard time seeing that uicontrol objects are not eventually going to end up on the chopping block as well since they run on Swing.
My interpretation is similar to @Tim . Anything that has a java underpinning is going to have to eventually be removed -- or if not removed, placed in some kind of auxillary legacy mode where it is not expected to function unless you have your own Java license. Mathworks is using the last supported free Java, but clearly that is not going to be sustainable: it is surely going to become unsupportable for security reasons at some point.
@Tim, ok, so will the recommended replacements on that page work for you?
Thank you for the follow up, but no: my problem is not specifically the use of something like javacomponent, rather that 1) the linked page implies a future end to support of all Swing-based components - which would include standard uicontrols - and it would help greatly to know how long I can hit the snooze button on transitioning, and 2) even supposing I was interested in the replacements they are all javascript based and I've found the new uifigure / javascript based guis to be very sluggish compared Swing based guis and don't want to migrate until the performance is accelerated.
In more context, I am working on a project with a lot of uicontrol objects. The project could see extensive future development and I am hesitant to update Matlab for fear that suddenly nothing works because uicontrols are no longer supported. I know they are still supported in the most recent Matlab version but wanted to see how far off on the horizon complete deprecation of Swing components would be, because there would be a lot of gui redesigning and re-scripting involved and I want to save myself the pain of transitioning to uifigures until there isn't a performance loss with the switch.
We won't know if there is a loss of performance in your particular implementation until you test it. You can keep using the old version of MATLAB for quite some time, if it's that important to you.
Sounds like you have an extremely time sensitive app, maybe one with real time updating (>30 screen updates per second needed) or with some sort of racing conditions so speed is extremely critical, as opposed to, say, just something like the user has to wait 0.5 seconds instead of 0.2 seconds for the display.
You could wait 10 years if you want and then only upgrade then when lots of other things have also changed or when/if MATLAB quits working on some next generation operating system.

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Release

R2020a

Asked:

Tim
on 19 Oct 2021

Commented:

on 20 Oct 2021

Community Treasure Hunt

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

Start Hunting!