Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
findjobj, editbox, border color :)

Subject: findjobj, editbox, border color :)

From: Chris

Date: 31 Oct, 2010 10:30:10

Message: 1 of 4

uD.PctText = uicontrol('Style','Edit',...
                'Units','Normalized',...
                'Position',sPos,...
                'ForegroundColor',[1.0 1.0 0.8],...
                'BackgroundColor',get(figure,'Color'),...
                'FontSize',10,...
                'String','0.0');
            
jPct = findjobj(uD.PctText);

I can see get(jPct.Border) has a pre-defined color:
LineColor = [0.670588 0.678431 0.701961]

I attempt to change it using set(jPct.Border,'LineColor',[0 0 0]). This gives no errors or warnings however when I look back into get(jPct.Border) LineColor remains unchanged, and the border in the GUI around the edit box is still gray.

Sorry if this is basic, I have never used Java before.

Subject: findjobj, editbox, border color :)

From: Yair Altman

Date: 31 Oct, 2010 19:07:03

Message: 2 of 4

Chris <skynet414@gmail.com> wrote in message <1693937765.219412.1288521040686.JavaMail.root@gallium.mathforum.org>...
> uD.PctText = uicontrol('Style','Edit',...
> 'Units','Normalized',...
> 'Position',sPos,...
> 'ForegroundColor',[1.0 1.0 0.8],...
> 'BackgroundColor',get(figure,'Color'),...
> 'FontSize',10,...
> 'String','0.0');
>
> jPct = findjobj(uD.PctText);
>
> I can see get(jPct.Border) has a pre-defined color:
> LineColor = [0.670588 0.678431 0.701961]
>
> I attempt to change it using set(jPct.Border,'LineColor',[0 0 0]). This gives no errors or warnings however when I look back into get(jPct.Border) LineColor remains unchanged, and the border in the GUI around the edit box is still gray.
>
> Sorry if this is basic, I have never used Java before.

This is easy to do:
http://undocumentedmatlab.com/blog/customizing-uicontrol-border/

Yair Altman
http://UndocumentedMatlab.com

Subject: findjobj, editbox, border color :)

From: Chris

Date: 31 Oct, 2010 21:10:48

Message: 3 of 4

Thanks, Works perfect - I'm surprised I wasn't able to find that page when searching your site earlier.

Subject: findjobj, editbox, border color :)

From: Yair Altman

Date: 31 Oct, 2010 23:03:04

Message: 4 of 4

Chris <skynet414@gmail.com> wrote in message <2047962899.227730.1288559478598.JavaMail.root@gallium.mathforum.org>...
> Thanks, Works perfect - I'm surprised I wasn't able to find that page when searching your site earlier.

Probably because I only posted it a few hours ago in response to your query...
:-)

-Yair

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us