Ask an expert. Trust the answer.

Your academic and career questions answered by verified experts

How to align text to the top of the button in Matlab GUI?

Date: 2022-12-20 12:13:56

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... 

Answers: 

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 );

 


Why Matlabhelpers ?

Our Matlab assignment helpers for online MATLAB assignment help service take utmost care of your assignments by keeping the codes simple yet of high-quality. We offer the most reliable MATLAB solutions to students pursuing their Computer Science course from the Monash University, the University of Sydney, the University of New South Wales, the University of Melbourne; to name a few. Approach us today for best Matlab solutions online!

whatsApp order on matlabhelpers.com

telegram order on matlabsolutions.com