[Appframework]: how to keep super from pack()'ing initially?

View: New views
1 Messages — Rating Filter:   Alert me  

[Appframework]: how to keep super from pack()'ing initially?

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the concrete frame in question - surprise, surprise :-) - it the mainframe of the SwingXSet: the layout still isn't clean enough to survive a pack. And don't intend to go for the real reason just now, still hoping the _real_ solution will drop out of the sky (which occasionally happens with layout probs). The original version in SwingSet3 side-stepped any problems by ...horror: freely setting preferredSizes and null layout.

This is a problem only in the very first run of the app, later the size/location is restored from persisted session state. A quick fix was to manually size the frame always - which wasn't a solution at all because it short-cuts the restored values. Now I came up with something looking extremely dirty: override configureWindow, pack, set a reasonable enough initial size and validate:

[code]
    @Override
    protected void configureWindow(Window root) {
        super.configureWindow(root);
        if (root == getMainFrame()) {
            // PENDING JW
            // brute force: prevent super from pack()'ing the mainframe
            // initially - actually it's a problem of our overall
            // layout, packing giving horrible results ...
            // we have to do it here (instead of in show as I assumed)
            // because super's injecting properties will invalidate
            root.pack();
            root.setBounds(0, 0, 1024, 748);
            root.validate();
        }
    }

[/code]

Probably overlooking something obvious - any ideas, what?

Thanks
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=370648

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...