I have a JDialogBox which is displayed for two different actions. When i double click on a table cell this dialog box is diplayed & also when i right click on the tabl cell this dialog gets displayed.
When it gets displayed for a double click all the components of that dialog are to be made visible. But when it gets displayed for a right click, one of the component (a panel on that dialog) should not be displayed & the space occupied by that component should be used evenly by other components.
We don't have too many rules around here but we do have a Naming Policy that we require all members to adhere to. Please read this policy and then adjust your display name accordingly.
Thanks.
Kriti Garg
Ranch Hand
Joined: Sep 13, 2004
Posts: 50
posted
0
Hi Neha,
I think choosing the right layout acc to ur requirement will help u out
as u didnot mention all the components to be shown i cannot say which one will suite to your requirement.
as far as one panel is consiserderd,just track the event in ur Jialog from which Jdiglog is shown (double or right click),u can set a flag also
and accordingly use add(component) and remove(component) method. for this panel.
Neha D
Ranch Hand
Joined: Oct 12, 2004
Posts: 32
posted
0
Hey thanx Kriti
I have modified the layout. Now I am using panels on JSplitPane & setting the divider location field of the JSplitPane when the dialog box is made visible on a right click so that the panel at the bottom of the JSplitPane is not visible.
But now the problem is that: Along with the JSplitPane, I have 2 more panels on the JDialogContentPane & therefore I am using the GridBagLayout. The JSplitPane is in between of the 2 panels. Now when I change the divider location of the JSplitPane, the components on the panel which is at the top of the JSplitPane resize themselves as the layout is GridBagLayout. But their is a lot of gap between the components & it is looking wierd.
I want to adjust all these compoenents accordingly so that the applet looks proper.
Can you plz help me out in this.
Thanx.
Regards, - Neha....
Kriti Garg
Ranch Hand
Joined: Sep 13, 2004
Posts: 50
posted
0
send ur code !
Kriti
Neha D
Ranch Hand
Joined: Oct 12, 2004
Posts: 32
posted
0
Heyy Kriti I am so sorry I cannot send u the code as it is very confidential.....
Now when I double click I can see the whole JDialog with all its components alligned properly... That is what i want.
Then when i right click I want the same dialog but one of the panel on the JSplitPane should not be visible. And all the other Components should get alligned properly. Now the remaining panel on the JSplitPane should accuire the whole space. That the Panel does but their is a lot of gap between these components. And this is what i want to reduce.
Thanx. Regards, - Neha
Kriti Garg
Ranch Hand
Joined: Sep 13, 2004
Posts: 50
posted
0
Hi,
what my expericence says u must be using GBC layout somewhere in ur this module.
GBC is powerful layout ,but if u donot use it correctly it can create blunder for u.
i am sending u a main class from which another class opens contiainig requied panels i have used BorderLayout for this.
You still have not conformed to our Naming Policy. Specifically you need your display name to be a First Last name format. Please do so or you risk having your account closed. We would rather keep you around here.