Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to make a JButton disappear?

807591Jun 3 2008 — edited Jun 4 2008
I have a JScrollPane and an arrayList of JButtons. When you click on a JButton, the JButton would disappear(only the click JButton). The class implements ActionListener(with ActionEvent ae. How do I make the JButton disappear. I tried doing JScrollPaneName.remove(ae.getSource())
and
if(ae.getSource() == ArrayListName.get(0))
{
ArrayListName.remove(0);
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2008
Added on Jun 3 2008
5 comments
673 views