Skip to main content

Appframework: possible to inject tab-titles?

3 replies [Last post]
kleopatra
Offline
Joined: 2003-06-11

_something_ is happening: unfortunately that something is not setting the title but the (absence) of an error message ;-)

assume a tabbedpane with name mytabs, then

# following line in the properties throws a PropertyResourceException (exact stack trace below
mytabs.titleAt = MyTitle

# following does nothing (no error, no setting)
mytabs.titleAt.0 = MyTitle

so somehow the property setting code is content with the latter but doesn't exactly do it - should it?

Thanks
Jeanette

<br />
Exception in thread "AWT-EventQueue-0"<br />
org.jdesktop.application.ResourceMap$PropertyInjectionException:<br />
can't set read-only property: resource hyperlinkTabs.titleAt, property titleAt,<br />
component javax.swing.JTabbedPane[hyperlinkTabs, .. // snippet tab description<br />
	at org.jdesktop.application.ResourceMap.injectComponentProperty(ResourceMap.java:1011)<br />
	at org.jdesktop.application.ResourceMap.injectComponentProperties(ResourceMap.java:1059)<br />
	at org.jdesktop.application.ResourceMap.injectComponent(ResourceMap.java:1125)<br />
	at org.jdesktop.application.ResourceMap.injectComponents(ResourceMap.java:1138)<br />
	at org.jdesktop.application.ResourceMap.injectComponents(ResourceMap.java:1153)<br />
	at org.jdesktop.swingx.demos.hyperlink.HyperlinkDemo.(HyperlinkDemo.java:84)<br />
	at org.jdesktop.swingx.demos.hyperlink.HyperlinkDemo$2.run(HyperlinkDemo.java:200)</p>
<p>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kleopatra
Offline
Joined: 2003-06-11

thanks - so stick to pulling in manually :-)

Jeanette

kschaefe
Offline
Joined: 2006-06-08

Jeanette,

The problem seems to be that the AppFramework does not seem to handle indexed properties (but then again what does?). I don't believe that there is a way to tackle this problem in the current implementation of the framework.

The reason that the latter silently fails is because the framework is designed to swallow problems when a property does not exist, but throws when a property does exist but is inaccessible. The former is happening because the property titleAt exists, but does not match the no-arg method type expected by the framework.

Karl

kschaefe
Offline
Joined: 2006-06-08

And yeah, I'd consider not handling indexed properties to be a bug. Indexed properties are part of the JavaBeans spec (though no one seems to care about them).

Karl