Forums Register Login

which the best way to add components

+Pie Number of slices to send: Send
Hi ALL,
I need your help .
The problem is i am totally confussed regarding this problem.How to add components to any component and the thing is the container to which iam adding should a colored one
so please guide me
bye
+Pie Number of slices to send: Send
The best ( and only ) way to add components to a container is through the container's add() method.

Though, if you are having problems adding components to containers and having them show up like you wanted them, then you are having problems with layout managers instead. Read about layout managers here... also it might be a problem with setting the component's preferred size too small... most layout managers use a component's preferred size to allocate space to it.

Coloring containers can easily be done using the setBackground( Color ) method. If the color doesn't show up, try calling setOpaque( true ) in the container right after setting the background color. Most containers are non-opaque ( i.e. "clear" ) so that you can see the root container's color through them.
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 574 times.
Similar Threads
looking for a special copoment
How to add components from the top of the JPanel using GridBagLayout?
Resizing a JButton in GridLayout
Rich Faces Modal Panel Problem
How to pop out a dialogBox?Help me please.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:18:18.