Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

deleting a component.  RSS feed

 
sun par
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am dragging a component from 1 panel to another in my program. As soon as I drop a component in the destination panel i want to delete the component in the source panel.How do I acheive this. I tried doing this

But its not working . Can someone help please
Thanks
 
Payam Fard
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try revalidate() or validate() on the container of the component you are trying to delete after you do setVisbile(false);
It might solve your problem.
Thanks,
Payam.
 
sun par
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not work, am getting runtime error, the type of component returned is java.awt.dnd.DragSourceContext. so I guess am getting run time error because I am trying to convert it to JComponent.
Just calling setVisible(false) and revalidate() does the job. Thank you.
[ April 04, 2003: Message edited by: sun par ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!