Start by setting the applet size (in formsweb.cfg) to 100% and separateFrame=false. In other words:
HEIGHT=100%
WIDTH=100%
separateFrame=false
Then in a WHEN-NEW-FORM-INSTANCE trigger, do something like this:
-- WIN_CENTER ------------------------------------------------------------------------- This procedure simply centers the named Window in the MDI Window.-- ----------------------------------------------------------------------------------PROCEDURE WIN_CENTER(winname in varchar2) IS xmax NUMBER ; --Maximum horizontal window size ymax NUMBER ; --Maximum verticle window size w NUMBER := get_window_property(winname, width);--Width of window being positioned h NUMBER := get_window_property(winname, height);--Height of window being positioned x NUMBER; -- X position of window being positioned. y NUMBER; -- Y position of window being positioned. y_offset_ln NUMBER := 0; --Verticle offset to take into account toolbar on client server. x_offset_ln NUMBER := 0; --Horizontal offset to take into account toolbar on client server.BEGIN IF get_application_property(USER_INTERFACE) = 'WEB' THEN --Hard coded values for running on the web because the mdi window size is not known. xmax := get_application_property(DISPLAY_WIDTH)- 30 ;--995; ymax := get_application_property(DISPLAY_HEIGHT)-160;--464; -- No offeset because ymax and xmax are hard coded on Web. x_offset_ln := 20; y_offset_ln := 4; ELSE xmax := get_window_property(FORMS_MDI_WINDOW, width); ymax :=get_window_property(FORMS_MDI_WINDOW, height); y_offset_ln := 0; x_offset_ln := 0; END IF; ymax := ymax - y_offset_ln; xmax := xmax - x_offset_ln; IF w > xmax THEN x := 0; ELSE x := (xmax - w)/2; END IF; IF h > ymax THEN y := 0; ELSE y := (ymax - h)/2; END IF; SYNCHRONIZE; set_window_property(winname,x_pos, x); set_window_property(winname,y_pos, y);END WIN_CENTER; ----------------------------------------------------------------------------------------------------------------------------------------------------------You may find that WHEN-NEW-FORM-INSTANCE is not the best trigger as the form is still being rendered while executing this trigger. It may be helpful to add a brief timer just before the SYNCHRONIZE. A 500ms - 1 second delay would probably work fine.
Also,
you can use this form
--this code for window1 :
set_window_property('WINDOW1',x_pos,(get_application_property(DISPLAY_WIDTH)-get_window_property('WINDOW1',width))/2);
set_window_property('WINDOW1',y_pos,(get_application_property(DISPLAY_height)-get_window_property('WINDOW1',height))/2);
--this code for forms_mdi_WINDOW :
set_window_property(forms_mdi_WINDOW,x_pos,(get_application_property(DISPLAY_WIDTH)-get_window_property(forms_mdi_window,width))/2);
set_window_property(forms_mdi_WINDOW,y_pos,(get_application_property(DISPLAY_height)-get_window_property(forms_mdi_WINDOW,height))/2);