• Post Reply Bookmark Topic Watch Topic
  • New Topic

Please help me people ..I'm still on the run !!

 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a bean and I've added the bean to the Visual Cafe component library which means that I can drag and drop the bean like any other swing components such as buttons, labels etc. So, when I specify the properties of the bean in the property list, the bean should resize accordingly.But, when I try this, the bean is showing up with its original size. I've called the ComponentResized callback for the bean to do the resizing. But, still not working. I'd like to know the procedural approach for this. Could somebody guide me with this ?!!
 
Brett Spell
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meghna,
Based on what you wrote, my understanding is that you've created and packaged a custom JavaBean, added it to Visual Cafe, dropped it onto an interface you're designing, and you want it to change size when you modify its properties. Is that correct? Presumably, the properties you're modifying are custom properties (i.e., you're not talking about the font or anything else that the bean inherits from Component or JComponent). If that's the case, try adding a call to revalidate() to the mutator ("setter") for each property that should result in a change to the component's appearance. For example:

Note that this assumes that you've extended JComponent or one of its subclasses, as revalidate() is defined in that class.
------------------
Brett Spell
Author, Professional Java Programming
 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on what you wrote, my understanding is that you've created and packaged a custom JavaBean, added it to Visual Cafe, dropped it onto an interface you're designing, and you want it to change size when you modify its properties. Is that correct? Presumably, the properties you're modifying are custom properties (i.e., you're not talking about the font or anything else that the bean inherits from Component or JComponent). If that's the case, try adding a call to revalidate() to the mutator ("setter") for each property that should result in a change to the component's appearance. For example:

Note that this assumes that you've extended JComponent or one of its subclasses, as revalidate() is defined in that class.
[/B]
Hi Brett
Thanks a lot for the all needed response. Yes, you've understood the problem right. But here's the actual thing -> I'm dragging the bean and dropping it onto a JFC applet. Now, the bean has its own properties. I've already defined the component resized callback for the bean for resizing. Now, when I resize the bean in the applet, the resizing is not occurring, neither are the methods I've written for the bean actually getting established.
Could you please suggest me something from the basics where I might've gone wrong, I mean could you suggest me the procedural approach for this particular problem ?!!
Thanks
Meghna
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!