*
The moose likes Beginning Java and the fly likes GUI question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "GUI question " Watch "GUI question " New topic
Author

GUI question

Shay Gaghe
Ranch Hand

Joined: Sep 03, 2001
Posts: 102
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
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
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
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
I tried to explain that to him before Cindy.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GUI question
 
Similar Threads
More complicated Program
Is it possible to shrink the size of the page you insert in iframe
IM and the protocol used
Can i have more than one ActionServlet in my web application
how to upload images