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:
Remove title bar

Subject: Remove title bar

From: Jerzy Nowakowski

Date: 14 May, 2007 05:40:22

Message: 1 of 10

Hi,

In options of the splash figure I changed the parameter "Windowstyle"
for 'modal'. However, I would like to create a professional splash
window without title bar.
how can I completely remove title bar in a figure window?

Thanks for help in advance.
Jerzy

Subject: Remove title bar

From: Jerome

Date: 14 May, 2007 05:56:36

Message: 2 of 10

Jerzy Nowakowski a écrit :

> how can I completely remove title bar in a figure window?

Hi,

you can't.

Read this :
http://www.mathworks.com/support/solutions/data/1-1AZWA.html

Jérôme

Subject: Remove title bar

From: Jerzy Nowakowski

Date: 14 May, 2007 08:04:10

Message: 3 of 10

Jérôme,

thank you.

Regards
Jerzy

 Jérôme wrote:
>
>
> Jerzy Nowakowski a écrit :
>
>> how can I completely remove title bar in a figure window?
>
> Hi,
>
> you can't.
>
> Read this :
> <http://www.mathworks.com/support/solutions/data/1-1AZWA.html>
>
> Jérôme
>

Subject: Remove title bar

From: Michael Wild

Date: 14 May, 2007 14:59:31

Message: 4 of 10

Jerzy Nowakowski wrote:
> Hi,
>
> In options of the splash figure I changed the parameter "Windowstyle"
> for 'modal'. However, I would like to create a professional splash
> window without title bar.
> how can I completely remove title bar in a figure window?
>
> Thanks for help in advance.
> Jerzy


something like the following does it. call it like this (or read the doc
for more options):

splash('ngc6543a.jpg',2)

function varargout = splash(fname, time, pos, siz)
%SPLASH create a splash screen
%
% Usage:
% splash(fname, time)
% splash(fname, time, pos, siz)
% f = splash(...)
% [f,t] = splash(...)
%
% Where:
% - fname : file name of an image to show
% - time : the time to show the splash screen for in seconds
% - pos : the position of the splash center in normalized screen
% coordinates (of the form [xpos, ypos]).
% defaults to [0.5 0.5]
% - siz : the size of the splash in pixels. defaults to the image size
% - f : the created frame
% - t : the timer object used to hide the splash screen after time
%

% set default position
if nargin < 3 || isempty(pos)
   pos = [0.5,0.5];
end

% read the image
if ~exist(fname)
   error('The image %s does not exist!',fname)
end
img = imread(fname);

% get the screen size
tk = java.awt.Toolkit.getDefaultToolkit();
d = tk.getScreenSize();

% determine the default splash size and resize image
if nargin < 4
   siz = size(img);
   siz = fliplr(siz(1:2));
else
   img = imresize(img,fliplr(siz));
end

% convert to java image
jimg = im2java(img);

% create the frame
frame = javax.swing.JFrame;
% remove decorations
frame.setUndecorated(true)

% put the image in the frame
icon = javax.swing.ImageIcon(jimg);
label = javax.swing.JLabel(icon);
frame.getContentPane.add(label);
frame.pack;

% set the size and location of the frame
frame.setSize(siz(1),siz(2));
frame.setLocation(pos(1) * d.width - siz(1)/2, ...
                   pos(2) * d.height - siz(2)/2);

% ta-daaaa
frame.show;

% now create the timer to close the thing again
t = timer('TimerFcn',@(a,b,c) frame.hide, ...
           'ExecutionMode', 'SingleShot', 'StartDelay', time);
start(t);

% output arguments
if nargout > 0
   varargout{1} = frame;
   if nargout > 1
     varargout{2} = t;
   end
end

Subject: Remove title bar

From: Jerzy Nowakowski

Date: 14 May, 2007 10:19:29

Message: 5 of 10

Michael Wild wrote:
>
>
> Jerzy Nowakowski wrote:
>> Hi,
>>
>> In options of the splash figure I changed the parameter
> "Windowstyle"
>> for 'modal'. However, I would like to create a professional
> splash
>> window without title bar.
>> how can I completely remove title bar in a figure window?
>>
>> Thanks for help in advance.
>> Jerzy
>
>
> something like the following does it. call it like this (or read
> the doc
> for more options):
>
> splash('ngc6543a.jpg',2)
>
> function varargout = splash(fname, time, pos, siz)
> %SPLASH create a splash screen
> %
> % Usage:
> % splash(fname, time)
> % splash(fname, time, pos, siz)
> % f = splash(...)
> % [f,t] = splash(...)
> %
> % Where:
> % - fname : file name of an image to show
> % - time : the time to show the splash screen for in seconds
> % - pos : the position of the splash center in normalized screen
> % coordinates (of the form [xpos, ypos]).
> % defaults to [0.5 0.5]
> % - siz : the size of the splash in pixels. defaults to the image
> size
> % - f : the created frame
> % - t : the timer object used to hide the splash screen after
> time
> %
>
> % set default position
> if nargin < 3 || isempty(pos)
> pos = [0.5,0.5];
> end
>
> % read the image
> if ~exist(fname)
> error('The image %s does not exist!',fname)
> end
> img = imread(fname);
>
> % get the screen size
> tk = java.awt.Toolkit.getDefaultToolkit();
> d = tk.getScreenSize();
>
> % determine the default splash size and resize image
> if nargin < 4
> siz = size(img);
> siz = fliplr(siz(1:2));
> else
> img = imresize(img,fliplr(siz));
> end
>
> % convert to java image
> jimg = im2java(img);
>
> % create the frame
> frame = javax.swing.JFrame;
> % remove decorations
> frame.setUndecorated(true)
>
> % put the image in the frame
> icon = javax.swing.ImageIcon(jimg);
> label = javax.swing.JLabel(icon);
> frame.getContentPane.add(label);
> frame.pack;
>
> % set the size and location of the frame
> frame.setSize(siz(1),siz(2));
> frame.setLocation(pos(1) * d.width - siz(1)/2, ...
> pos(2) * d.height - siz(2)/2);
>
> % ta-daaaa
> frame.show;
>
> % now create the timer to close the thing again
> t = timer('TimerFcn',@(a,b,c) frame.hide, ...
> 'ExecutionMode', 'SingleShot', 'StartDelay', time);
> start(t);
>
> % output arguments
> if nargout > 0
> varargout{1} = frame;
> if nargout > 1
> varargout{2} = t;
> end
> end
>
  
Michael,

Thanks for your interest.
I use R13 and it does not work. So now my question is what are the
java requirements for Matlab, because it stucks at any java method.
Currently I'm downloading "Windows Platform - J2SE(TM) Development
Kit 5.0 Update 11" We'll see whether it will work.

Regards
Jerzy

Subject: Remove title bar

From: Jerzy Nowakowski

Date: 14 May, 2007 11:34:09

Message: 6 of 10

Jerzy Nowakowski wrote:
>
>
> Michael Wild wrote:
>>
>>
>> Jerzy Nowakowski wrote:
>>> Hi,
>>>
>>> In options of the splash figure I changed the parameter
>> "Windowstyle"
>>> for 'modal'. However, I would like to create a professional
>> splash
>>> window without title bar.
>>> how can I completely remove title bar in a figure window?
>>>
>>> Thanks for help in advance.
>>> Jerzy
>>
>>
>> something like the following does it. call it like this (or
read
>> the doc
>> for more options):
>>
>> splash('ngc6543a.jpg',2)
>>
>> function varargout = splash(fname, time, pos, siz)
>> %SPLASH create a splash screen
>> %
>> % Usage:
>> % splash(fname, time)
>> % splash(fname, time, pos, siz)
>> % f = splash(...)
>> % [f,t] = splash(...)
>> %
>> % Where:
>> % - fname : file name of an image to show
>> % - time : the time to show the splash screen for in seconds
>> % - pos : the position of the splash center in normalized
> screen
>> % coordinates (of the form [xpos, ypos]).
>> % defaults to [0.5 0.5]
>> % - siz : the size of the splash in pixels. defaults to the
> image
>> size
>> % - f : the created frame
>> % - t : the timer object used to hide the splash screen
after
>> time
>> %
>>
>> % set default position
>> if nargin < 3 || isempty(pos)
>> pos = [0.5,0.5];
>> end
>>
>> % read the image
>> if ~exist(fname)
>> error('The image %s does not exist!',fname)
>> end
>> img = imread(fname);
>>
>> % get the screen size
>> tk = java.awt.Toolkit.getDefaultToolkit();
>> d = tk.getScreenSize();
>>
>> % determine the default splash size and resize image
>> if nargin < 4
>> siz = size(img);
>> siz = fliplr(siz(1:2));
>> else
>> img = imresize(img,fliplr(siz));
>> end
>>
>> % convert to java image
>> jimg = im2java(img);
>>
>> % create the frame
>> frame = javax.swing.JFrame;
>> % remove decorations
>> frame.setUndecorated(true)
>>
>> % put the image in the frame
>> icon = javax.swing.ImageIcon(jimg);
>> label = javax.swing.JLabel(icon);
>> frame.getContentPane.add(label);
>> frame.pack;
>>
>> % set the size and location of the frame
>> frame.setSize(siz(1),siz(2));
>> frame.setLocation(pos(1) * d.width - siz(1)/2, ...
>> pos(2) * d.height - siz(2)/2);
>>
>> % ta-daaaa
>> frame.show;
>>
>> % now create the timer to close the thing again
>> t = timer('TimerFcn',@(a,b,c) frame.hide, ...
>> 'ExecutionMode', 'SingleShot', 'StartDelay', time);
>> start(t);
>>
>> % output arguments
>> if nargout > 0
>> varargout{1} = frame;
>> if nargout > 1
>> varargout{2} = t;
>> end
>> end
>>
>
> Michael,
>
> Thanks for your interest.
> I use R13 and it does not work. So now my question is what are the
> java requirements for Matlab, because it stucks at any java method.
> Currently I'm downloading "Windows Platform - J2SE(TM) Development
> Kit 5.0 Update 11" We'll see whether it will work.
>
> Regards
> Jerzy

Hi again,

so I have problems with Java using R13. I installed J2SE from sun (as
written above) and it does not work.

??? Error: File: C:\Programmi\MATLAB\work\simulator\gui\splashh.m
Line: 33 Column: 41
Expected a variable, function, or constant, found ")".

Line 33 is
---------------------------------------
tk = java.awt.Toolkit.getDefaultToolkit()
---------------------------------------

What shall I do?

Regards
Jerzy

Subject: Remove title bar

From: Yair Altman

Date: 14 May, 2007 11:42:42

Message: 7 of 10

simply remove the empty parentheses () - R13 and below did not allow
them (only Matlab 7+).

Yair Altman

Subject: Remove title bar

From: Michael Wild

Date: 14 May, 2007 17:46:02

Message: 8 of 10

Jerzy Nowakowski wrote:
> Michael Wild wrote:
>>
>> Jerzy Nowakowski wrote:
>>> Hi,
>>>
>>> In options of the splash figure I changed the parameter
>> "Windowstyle"
>>> for 'modal'. However, I would like to create a professional
>> splash
>>> window without title bar.
>>> how can I completely remove title bar in a figure window?
>>>
>>> Thanks for help in advance.
>>> Jerzy
>>
>> something like the following does it. call it like this (or read
>> the doc
>> for more options):
>>
>> splash('ngc6543a.jpg',2)
>>
>> function varargout = splash(fname, time, pos, siz)
>> %SPLASH create a splash screen
>> %
>> % Usage:
>> % splash(fname, time)
>> % splash(fname, time, pos, siz)
>> % f = splash(...)
>> % [f,t] = splash(...)
>> %
>> % Where:
>> % - fname : file name of an image to show
>> % - time : the time to show the splash screen for in seconds
>> % - pos : the position of the splash center in normalized screen
>> % coordinates (of the form [xpos, ypos]).
>> % defaults to [0.5 0.5]
>> % - siz : the size of the splash in pixels. defaults to the image
>> size
>> % - f : the created frame
>> % - t : the timer object used to hide the splash screen after
>> time
>> %
>>
>> % set default position
>> if nargin < 3 || isempty(pos)
>> pos = [0.5,0.5];
>> end
>>
>> % read the image
>> if ~exist(fname)
>> error('The image %s does not exist!',fname)
>> end
>> img = imread(fname);
>>
>> % get the screen size
>> tk = java.awt.Toolkit.getDefaultToolkit();
>> d = tk.getScreenSize();
>>
>> % determine the default splash size and resize image
>> if nargin < 4
>> siz = size(img);
>> siz = fliplr(siz(1:2));
>> else
>> img = imresize(img,fliplr(siz));
>> end
>>
>> % convert to java image
>> jimg = im2java(img);
>>
>> % create the frame
>> frame = javax.swing.JFrame;
>> % remove decorations
>> frame.setUndecorated(true)
>>
>> % put the image in the frame
>> icon = javax.swing.ImageIcon(jimg);
>> label = javax.swing.JLabel(icon);
>> frame.getContentPane.add(label);
>> frame.pack;
>>
>> % set the size and location of the frame
>> frame.setSize(siz(1),siz(2));
>> frame.setLocation(pos(1) * d.width - siz(1)/2, ...
>> pos(2) * d.height - siz(2)/2);
>>
>> % ta-daaaa
>> frame.show;
>>
>> % now create the timer to close the thing again
>> t = timer('TimerFcn',@(a,b,c) frame.hide, ...
>> 'ExecutionMode', 'SingleShot', 'StartDelay', time);
>> start(t);
>>
>> % output arguments
>> if nargout > 0
>> varargout{1} = frame;
>> if nargout > 1
>> varargout{2} = t;
>> end
>> end
>>
>
> Michael,
>
> Thanks for your interest.
> I use R13 and it does not work. So now my question is what are the
> java requirements for Matlab, because it stucks at any java method.
> Currently I'm downloading "Windows Platform - J2SE(TM) Development
> Kit 5.0 Update 11" We'll see whether it will work.
>
> Regards
> Jerzy


sorry, i have no idea for R13... the thing i did uses swing, but you
could just as well do it with awt (although it probably would be a bit
more laborious).

i have R2007a, so i can't really help you. however, most of the code i
used i found on the help page of im2java where they show an example of
how to display an image in a java window. perhaps you can look at it and
see if it is any different.


Michael

Subject: Remove title bar

From: Jerzy Nowakowski

Date: 15 May, 2007 04:22:45

Message: 9 of 10

Yair Altman wrote:
>
>
> simply remove the empty parentheses () - R13 and below did not
> allow
> them (only Matlab 7+).
>
> Yair Altman
  
Yair,

thanks for help. The problem with parentheses () is resolved, a new
one appeared:
----------------
% now create the timer to close the thing again
t = timer('TimerFcn', @(a,b,c)
frame.hide,'ExecutionMode','SingleShot', 'StartDelay', time);
start(t);
----------------
??? Error: File: C:\Programmi\MATLAB\work\simulator\gui\splashh.m
Line: 67 Column: 24
"identifier" expected, "(" found.
----------------
it is exactly between @ and (
----------------
I am confused again.

Ragards
Jerzy

Subject: Remove title bar

From: Yair Altman

Date: 15 May, 2007 05:43:15

Message: 10 of 10

R13 does not recognize anonymous functions: @(...)
Instead, try to 'stringize' it, something like this:
['myFunc(' num2str(value1) ',' num2str(value2) ')'] or using the
sprintf() function.

BTW, I'm not sure R13 had the timer function at all - no use fixing
the anon func if there's no timer to use it, so find this out first
(help timer)

Yair Altman

Tags for this Thread

No tags are associated with 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