File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Replacing a specific Jbutton in a grid  with 8 new buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Replacing a specific Jbutton in a grid  with 8 new buttons " Watch "Replacing a specific Jbutton in a grid  with 8 new buttons " New topic
Author

Replacing a specific Jbutton in a grid with 8 new buttons

stup walker
Greenhorn

Joined: Mar 11, 2004
Posts: 1
Hi
I am using a package where all the buttons are added to a gridbag (4 rows and two colu) using a function call from the constructur of buttons class again the grid internally contains
a box layout for each row and JButtons are added in this BOX these JButtons
are of Type portButtons which are initialized in other class portButtons which is in diffrent .java file.The Listener are implemented in portButtons class.
Now i needs to be replaced the button from top row with 8 new buttons when the Button corresponding to it in third row is clicked.
IS there any method by which i can dynamically remove the components of JPanel in action listener and replace it with 8 new buttons and also romving and readding the other components of JPanel.how to use paint and repaint method to remove and add new buttons.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replacing a specific Jbutton in a grid with 8 new buttons