I tried the following code to resize it and it works! However I have trouble because I need its size to be proportional to the screen but i get different screen sizes and I don't get the difference among the several outcomes:
ances=desktop.getGroupContainer('myGroup').getTopLevelAncestor
% desktop size
desktopMainFrame = desktop.getMainFrame;
desktopDims = desktopMainFrame.getSize
desktopW = desktopDims.getWidth
desktopH = desktopDims.getHeight
desktopW =
2902
desktopH =
1582
% define position and size
ances.setSize(0.22*desktopDims.getWidth,0.72*desktopDims.getHeight)
ances.setLocation(0.03*desktopDims.getWidth,0.13*desktopDims.getHeight)
But I don't get the reason I had different result with this and:
Pix_SS = get(0,'screensize')
Pix_SS =
1 1 1920 1080
Or:
ScreenPixelsPerInch = java.awt.Toolkit.getDefaultToolkit().getScreenResolution()
ScreenDevices = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
MainScreen = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getScreen()+1;
MainBounds = ScreenDevices(MainScreen).getDefaultConfiguration().getBounds();
MonitorPositions = zeros(numel(ScreenDevices),4);
for n = 1:numel(ScreenDevices)
Bounds = ScreenDevices(n).getDefaultConfiguration().getBounds();
MonitorPositions(n,:) = [Bounds.getLocation().getX() + 1,-Bounds.getLocation().getY() + 1 - Bounds.getHeight() + MainBounds.getHeight(),Bounds.getWidth(),Bounds.getHeight()];
end
MonitorPositions
MonitorPositions =
1 1 2880 1620