This content has been marked as final. Show 3 replies
I would like to kno how to set the window height and width so users cannot resize it.
..I would like the methods to be out of the library objectdrawThe what library? Never heard of it. Is it J2SE or 3rd party?
motherboarddude wrote:What does 'no clue' mean? That you have no clue if it is J2SE? The answer is no, it is not J2SE (or even a Sun standard extension like JavaHelp or JOGL). We know nothing about that API and can provide no help with it.
[http://eventfuljava.cs.williams.edu/library/objectdrawJavadocV1.1.2/index.html] no clue
(And in future, try to make your replies specific enough that people do not have to 'guess' what you mean. That becomes irritating, very quickly.)
OTOH a brief perusal of the JavaDocs suggests the API has no component that extends Frame or JFrame, so the answer to your request that it use one of the methods of your custom library is "No, it provides no functionality to restrict the size of the frame the user is offered - since that frame will come from the J2SE".
Of course, if you simply wanted to ensure the drawing canvas is never resized, simply add it as a 'no args' element in a GridBagLayout with no other GUI components in it. If the GBL is used as described, the component will be centered within it. Add a JScrollPane to the component in case the user shrinks the frame smaller than the preferred size of the drawing area. In Java 1.6+, call setMinimumSize() after packing, and you can afford to lose the scroll pane.