如何对齐文本在Matlab GUI按钮的顶部? [英] How to align text to the top of the button in Matlab GUI?

查看:1011
本文介绍了如何对齐文本在Matlab GUI按钮的顶部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大按钮的GUI和wouls喜欢在按钮上的文本对齐顶端,所有我发现的是水平对齐属性。
谢谢...

I have a GUI with big buttons and wouls like to align the text in the button to the top, all I found is "horizontal alignment" property. Thanks...

推荐答案

您需要访问底层Java Swing组件(我用<一个href=\"http://www.mathworks.com/matlabcentral/fileexchange/14317-findjobj-find-java-handles-of-matlab-graphic-objects\">FINDJOBJ功能):

You need to access the underlying Java Swing component (I am using FINDJOBJ function):

figure('Menubar','none', 'Position',[200 200 300 200])
h = uicontrol('Style','pushbutton', 'String','click', ...
   'Units','normalized', 'Position',[0.3 0.3 0.5 0.5]);
jh = findjobj(h);
jh.setVerticalAlignment( javax.swing.AbstractButton.BOTTOM );

这篇关于如何对齐文本在Matlab GUI按钮的顶部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆