Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Extending Swing Class - View Properties(Does WindowBuilder understand properties for Extended Class)
Extending Swing Class - View Properties [message #1844996] Sat, 02 October 2021 12:29 Go to next message
David Garratt is currently offline David GarrattFriend
Messages: 42
Registered: July 2011
Member
My Swing application uses a lot of extended classes so for enable I have a class called JButton4j which extends JButton. This lets me set certain properties by default and make it easier to adopt a standard look.

If I click on one of my Frames which has an instance of JButton on it I see all the properties. However if I click on a JButton4j then I see very few properties.

See attached.

Is this a known issue, a bug or am I failing to do something myself ?

Re: Extending Swing Class - View Properties [message #1846933 is a reply to message #1844996] Sat, 09 October 2021 13:49 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Your screenshot shows more properties for JButton4j than for the JButton. The screenshot contradicts your text.
Re: Extending Swing Class - View Properties [message #1846937 is a reply to message #1846933] Sat, 09 October 2021 14:05 Go to previous messageGo to next message
Dave Garratt is currently offline Dave GarrattFriend
Messages: 3
Registered: October 2021
Junior Member
Sorry for my bad description - what I should have said was that it has the properties listed in the inspector but many values which I had assumed would be present as they are inherited don't seem to be there.
Re: Extending Swing Class - View Properties [message #1846938 is a reply to message #1846933] Sat, 09 October 2021 14:09 Go to previous message
David Garratt is currently offline David GarrattFriend
Messages: 42
Registered: July 2011
Member
Sorry for my poor description - I should have said I was confused by the missing values for the properties.

Would the source for the button class help.

public class JButton4j extends JButton {

	private static final long serialVersionUID = 1L;

	public JButton4j() {
		setFont(Common.font_btn);
	}

	public JButton4j(Icon icon) {
		super(icon);
		setFont(Common.font_btn);
	}

	public JButton4j(String text) {
		super(text);
		setToolTipText(text);
		setFont(Common.font_btn);
	}

	public JButton4j(Action a) {
		super(a);
		setFont(Common.font_btn);
	}

	public JButton4j(String text, Icon icon) {
		super(text, icon);
		setToolTipText(text);
		setFont(Common.font_btn);
	}
	
	@Override
	public void setText(String text)
	{
		super.setText(text);
		setToolTipText(text);
	}

}


[Updated on: Sat, 09 October 2021 14:11]

Report message to a moderator

Previous Topic:Eclipse Marketplace install options (versions)
Next Topic:Window builder fails to install
Goto Forum:
  


Current Time: Sat Nov 26 20:35:33 GMT 2022

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

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

Back to the top