Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Custom component public property not shown in property pane(WindowBuilder setting extended class properties)
Custom component public property not shown in property pane [message #1830503] Mon, 27 July 2020 23:04 Go to next message
John Osborne is currently offline John OsborneFriend
Messages: 7
Registered: June 2020
Junior Member
I must be missing something fundamental.
I have created a new subclass of JComponent in its own project
I have added a private variable to this called called myInt
I have created public getter and setter for myInt
I have built the project
I have exported the project to a jar file
I have created a separate project to test my custom JComponent
I have added to jar file as a library to the test project and imported it in my test project
I have added my customer component to my test project's palette via Palette Manager.
I can drag my custom JComponent onto my test project's JFrame
The component displays properly both at design time an run time

Problem: when selecting my custom component in the test project, the property pane does not show myInt as a property.

What am I doing wrong/what have I missed such that custom properties are not displayed in the property pane even though the public getter/setter is accessible by the test project?
Re: Custom component public property not shown in property pane [message #1830508 is a reply to message #1830503] Tue, 28 July 2020 04:23 Go to previous messageGo to next message
John Osborne is currently offline John OsborneFriend
Messages: 7
Registered: June 2020
Junior Member
First let me apologize for wasting people's time.
I have since updated Java OpenJDK11 to Oracle's Java 13.02 (includes JDK ,Java, etc.) and updated both the custom JComponent and the test projects to use it
After a little drama getting javax.swing to be located, my myInt property is now appearing in Windowbuilder property pane.

Still not sure why the background Color property isn't though (blank dropdown box instead of being able to choose a color).
Re: Custom component public property not shown in property pane [message #1830619 is a reply to message #1830508] Wed, 29 July 2020 23:50 Go to previous message
John Osborne is currently offline John OsborneFriend
Messages: 7
Registered: June 2020
Junior Member
More and more curious.

i noticed the myInt getter's type was Integer, not int.

I added a new private field to my extended JComponent class called myChar,
and also a getter returning typ char and a setter taking an argument of type char.

Rebuilding the extended JComponent class, exporting its jar and using it in the test application, once again , once again myChar shows a blank dropdown instead of letting me enter a value of 'Z', or any character.

Changing the return type of of the getter from char to Character fixes this.

Can anyone explain this?
Previous Topic:Databinding uses Deprecated WidgetProperties class
Next Topic:WindowBuilder Mac Crash
Goto Forum:
  


Current Time: Wed Sep 28 10:33:42 GMT 2022

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

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

Back to the top