Skip to main content



      Home
Home » Archived » Visual Editor (VE) » Instantiating derrived component
Instantiating derrived component [message #88466] Mon, 25 April 2005 09:04 Go to next message
Eclipse UserFriend
Originally posted by: vladis.gemtek.lt

Hi,

I am new to VE. Sorry if this was asked a million times:

I have my text field, i.e. MyTextField which is derrived from JTextField. I
want to instantiate MyTextField not JTextField. Everytime I try to cheat VE
I run into problems:

private JTextField getJTextField1() {
if (jTextField1 == null) {
jTextField1 = new MyTextField(); // I want MyTextField.
}
return jTextField1;
}

After editing source this way, I am not able to edit properties of changed
component in VE. I wouldn't mind if VE just let me operate on control as
JTextField. Is only way to add derrived component is write custom widget?
Most of my components are simply derrived from original Swing ones.

Best regards,
Vladas
Re: Instantiating derrived component [message #88538 is a reply to message #88466] Mon, 25 April 2005 10:05 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

As long as your class has a default constructor (a ctor with no
arguments) you should be able to use the "Choose Bean" and select your
class from there. There is no need to "fake" it out. The "ChooseBean" is
on the palette (third entry from the top if I remember correctly).


--
Thanks,
Rich Kulp
Re: Instantiating derrived component [message #607239 is a reply to message #88466] Mon, 25 April 2005 10:05 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

As long as your class has a default constructor (a ctor with no
arguments) you should be able to use the "Choose Bean" and select your
class from there. There is no need to "fake" it out. The "ChooseBean" is
on the palette (third entry from the top if I remember correctly).


--
Thanks,
Rich Kulp
Previous Topic:newbie following tutorial, immediate exception
Next Topic:VE Installation
Goto Forum:
  


Current Time: Sun Jun 15 12:22:09 EDT 2025

Powered by FUDForum. Page generated in 0.03466 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top