Originally posted by: Bacardi151
Originally posted by: statik213
Well I know that you can do a contentpane.remove() and contentpane.add() but I want to add the new component exactly where the old one was.
In some layouts the orders in which componets are added matter, so I don't want to affect the layout of the rest of the components too much. So if I do a .remove() on something that was inserted first and do a .add() it'll end up at the bottom-right position instead of the top-left in a grid llayout for example. I want to be able to change the top-left cell's contents, but I want to know if there's a general method for any layout manager.
i wasn't talking about ...remove() or add()... i dont really see how they could have that. cuz if you dont want one you simply remove the code that represented the button, or u just add the code needed for the button.
there should not be any effect in regards to the order of how you lay out the buttons, unless you mean that it effects the looks of the GUI, in fact if you're just replacing a button then, like i said earlier, you just change the method for it.