File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replacing a specific Jbutton in a grid with 8 new buttons

 
stup walker
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic