Skip to main content

Question about MetaData

1 reply [Last post]
Joe Bruin
Offline
Joined: 2006-02-17
Points: 0

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Amy Fowler

definitely a bug! the "label" property *should* be used as the default
header title. Please file an issue at

https://jdnc.dev.java.net/servlets/ProjectIssues

thanks,
Aim

jdnc-interest@javadesktop.org wrote:

> There was a brief discussion about the “label” field in an earlier discussion about MetaData, but it did not appear to address my specific question.
>
> According to the MetaData documentation, the “label” field contains a user-displayable label for the data field. The label is intended for display to the end-user. Yet when I run the simple program below, the “name” field is displayed in the JXTable column header rather then the “label” field. Is this a misunderstanding on my part of the function of the “label” field or on the behavior of some of the other JDNC API? If so, I’d appreciate knowing what the purpose of the “label” field is, and I’d recommend that the documentation be revised to clarify this point.
>
> The data file is a simple tab-delimited file containing rows of first and last names. The first row does not contain header names.
>
> When I run the following program, “first” and “last” are displayed in the column headers rather then “First Name” and “Last Name”.
>
>
> public class Example {
>
> public static void main(String[] args) throws IOException {
> TabularDataModel tabularDataModel = new TabularDataModel(2);
>
> MetaData column0MetaData =
> new MetaData("first", String.class, "First Name");
> tabularDataModel.setColumnMetaData(0, column0MetaData);
>
> MetaData column1MetaData =
> new MetaData("last", String.class, "Last Name");
> tabularDataModel.setColumnMetaData(1, column1MetaData);
>
> URL url = Example.class.getResource("/data/example.dat");
> tabularDataModel.setSource(url);
>
> TabularDataTextLoader loader =
> new TabularDataTextLoader("\t", false, 5);
> tabularDataModel.setLoader(loader);
> tabularDataModel.startLoading();
>
> JXTable table = new JXTable(tabularDataModel);
> JScrollPane scroller = new JScrollPane(table);
>
> JXFrame frame = new JXFrame();
> frame.getContentPane().add(scroller);
> frame.setVisible(true);
> }
> }
>
> Joe Bruin
> ---
> [Message sent by forum member 'Joe Bruin' (Mike Carlin)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=21728&#21728
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
> For additional commands, e-mail: jdnc-help@jdnc.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net