I used a JFrame includeing a Container, thus ,I set Container with GridBagLayout,but it seems that I even can't put the JToolBar at the top of the Container. it always at the center of the Container. I already use the GridBagConstraints, but it didn't affect too much. I got confused about the GridBagConstraints. how should i set the gridx,gridy,gridweitht,gridheight,weightx,weithty,fill,anchor to make sure the toolbar is at the top of the Container, my ComboBox Panel is under that, my JTable Panel is under the ComboBox Panel! thanks!
Sun Certified Java Programmer, Sun Certified Java Developer. <br />Strving to be a real architect.
posted 13 years ago
I think you want to have an outer panel for the JToolbar and use a BorderLayout so it can dock to any of the sides. Then add your panel with the GridBagLayout in to the outer panel using BorderLayout.CENTER and you should be Ok.
SCJP, SCJD, SCEA 5 "Any sufficiently analyzed magic is indistinguishable from science!" Agatha Heterodyne (Girl Genius)
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads