Hi (Swing) i have three questions : 1.im using null layout and i pathing the components with setBounds() , i see that the reshape() does the same thing , there is a different? 2.im extending Canvas and JPanel , how to get access to its container( like getContentPane() in a JFrame)? 3.how can i make my window to by fixed size (disable rsizing by the user)? thanks Shay
Joined: Sep 29, 2000
1 Using a null layout is REALLY not a good idea. It is very difficult to know what the screen will look like on different operating system and after the user is done messing with it. A LayoutManager will save you a ton of headaches in the long run. reshape is deprecated. Don't use it. 2. Canvas is not a part of Swing and does not have a ContentPane. Only top level Containers have contentPanes anyway. Canvas is not a container. You can not do an add() to canvas. 3. If you had a LayoutManager you wouldn't need to ask this question.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Null layout is not a bad thing. I use null layout for everything and have no problems with crossplatform. You just have to cover your basis. 1. Don't let the user resize any windows 2. Restrict the user to a minimum screen resolution. (most will agree the min is 800X600) 3. Set a universal Font so that it is the same on all platforms I have been doing that, and have not had a problem as of yet. Just my two cents