Set focus inside an UI figure

I am trying to programatically set/change the focus to a specific component (typically a button) within an UI figure, created in AppDesigner. Any ideas?

3 件のコメント

Xiangrui Li
Xiangrui Li 2019 年 11 月 1 日
編集済み: Xiangrui Li 2019 年 11 月 1 日
I am looking for a solution to set off focus for a uifigure component. In figure, I simply use uicontrol(dummyText) to move the focus to a dummy text, but this is not available to uifigure. For now, I use a dumb method to move focus away: java.awt.Robot() to move mouse to empty area, do a Robot mouse press and release, and move mouse back to original location. To focus to a uibutton, you can move mouse to the button, press, move back to orginal location, then release mouse. I say it dumb, since uifigure tries to stay away from java.
Adam Danz
Adam Danz 2022 年 4 月 5 日
There are some new tools in MATLAB R2022a to set tab order and focus to UI components.
Johan
Johan 2022 年 4 月 6 日
Great, thank you

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

製品

リリース

R2018b

質問済み:

2019 年 6 月 7 日

コメント済み:

2022 年 4 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by