Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need to display stand alone ADF Swing application in full Screen Mode

Mohammed JahangirAug 23 2016 — edited Aug 23 2016

Dear Gurus,

I have created stand alone ADF application, with Java Desktop Application (ADF) wizard. I have created edit form through wizard and able to run it, My requirement is to run the form/application in full screen mode. 

frame.setsetUndercorated(true) is throwing  java.awt.illegalcomponentstateexception the frame is displayable Exception and frame is getting close. Kindly help me to get out of it. or let me know other approach to achieve my requirement.

    public static void main(String[] args) {

       

//        JFrame frame1 = new JFrame();

////        frame1.setExtendedState(JFrame.MAXIMIZED_BOTH);

//        frame1.setUndecorated(true);

//        frame1.setVisible(true);

        try {

            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

        } catch (Exception exemp) {

            exemp.printStackTrace();

        }

        try {

            JUMetaObjectManager.setErrorHandler(new JUErrorHandlerDlg());

            JUMetaObjectManager mgr = JUMetaObjectManager.getJUMom();

            mgr.setJClientDefFactory(null);

            BindingContext ctx = new BindingContext();

            ctx.put(DataControlFactory.APP_PARAM_ENV_INFO, new JUEnvInfoProvider());

            ctx.setLocaleContext(new DefLocaleContext(null));

            HashMap map = new HashMap(4);

            map.put(DataControlFactory.APP_PARAMS_BINDING_CONTEXT, ctx);

            mgr.loadCpx("view.DataBindings.cpx", map);

            final EmployeeForm frame = new EmployeeForm();

           

            frame.setBindingContext(ctx);

            frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

            Dimension frameSize = frame.getSize();

            if (frameSize.height > screenSize.height) {

                frameSize.height = screenSize.height;

            }

            if (frameSize.width > screenSize.width) {

                frameSize.width = screenSize.width;

            }

//            frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);

            frame.setExtendedState(JFrame.MAXIMIZED_BOTH);

            frame.setVisible(true);

        

           

            frame.setUndecorated(true);

        } catch (Exception ex) {

            JUMetaObjectManager.reportException(null, ex, true);

            System.exit(1);

        }

    }

This post has been answered by Mohammed Jahangir on Aug 23 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2016
Added on Aug 23 2016
2 comments
426 views