wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes java.awt what is going on??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "java.awt what is going on???" Watch "java.awt what is going on???" New topic
Author

java.awt what is going on???

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Can some one please explanin how this is being done. I always thought of drawing diagrams of the the topmost container holding the innermost container. Also the top most container in this code is FlowLayout defaulting it to LEFT, then a panel p1 with FlowLayout, panel p2 with BorderLayout and panel p3 with GridLayout. What I am asking is if this kindda question comes in java cert what is the best way to approach it??
Also I have added the Color to each container, however I never see Color.black??? Why


Thanks in advance for your help!!!
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
You don't see any black background in panel p2 because it does not have anything in it except the panel p1, - the south position fills the entire layout.
The use of the word "topmost" is confusing - we speak of the top-level container which contains all the other stuff, or the component "on top" which means the one exposed to the user - as opposed to hidden by something else.
Bill
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Bill
I want to know given the code how would YOU have interpreted the code?? Basically I wanna know the sequence of this code.
I will be careful not to use top leve container
Thanks
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Bill
I want to know given the code how would YOU have interpreted the code?? Basically I wanna know the sequence of this code.
I will be careful not to use top leve container
Thanks
Shivaji Marathe
Ranch Hand

Joined: Jan 11, 2002
Posts: 203
Amish :
I believe there _may_ be similar questions on the real certification exam - there will be several containers, one inside the other and there will be a question on the appearance of one of the components.
The best way to do this is to do it in two passes. In the first pass, just draw each of the containers with their respective layout managers.
So for this example you will have three rectangles P1, P2 and P3 with flow , border and grid layouts respectively. Remember to mark any font and back/foreground color settings as well.
In the second pass draw all the components within these containers.
So the button gets added to P1,then P1 gets added to P2 and P2 gets added to P3. You can just use arrows do denote that P3 contains P2 which contains P1. No need to really redraw the three panels.
Finally add P3 to the frame and you have a complete picture of what the code is trying to do.
Hope this helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.awt what is going on???