tags:

views:

54

answers:

3

i want to make a jPanel ( vehicleListPanel) with two column like this NAME | button name | button ... left column show vehicle name , and right to show an icon proper with vehicle status (red, green icon) ...

i try to make it, but there is problems with button size, i can't set it how i want,

plz help me with example thanks

+1  A: 

You can use GridLayout if you want all the columns to have the same width.

It would be helpful if you show some code.

Jonas
+1  A: 

If you are having problem with sizes, then you are either specifying the wrong size, or else, you have some layout manager that is taking over and changing the sizes. If you are building the GUI yourself without any use of Drag Drop facilities like Netbeans and Eclipse provide, you might want to use this:

vehicleListPanel.setLayout(null);

This leaves everything up to you though. Just like Sanoj said, it would be helpful if you gace us some code.

npinti
+2  A: 

If you have NetBeans, you can use the GUI designer to do this by visually dragging, dropping, and resizing your component without even specifying a layout. Even if ultimately you don't want to use NetBeans, you can look at the generated code to know how you can achieve a similar result manually.

JRL
ok, thanks, but netbean do it very professional , can i use it?i want add or remove buttons dynamcally...
sirvan
@sirvan: Sorry, I don't understand your comment.
JRL
soory, the problem is me, i cant write english good,but, i use netbeans GUI designer and its possible to use the generated code to custome what i want, the problem with this idea is finding a way to repeating creating cpmponent and add them to panle, but i think i can do thatthank u
sirvan