In my application, I have a “meta” class to store information about the app (e.g., version).
For example:
class AppMetaData {
public static final String version = "beta2";
public static final String server = ...
...
}
In NetBeans, I have a JLabel on the main frame of my application. I want it’s value to be populated from this MetaClass. However the code is auto-generated for it and I see no way to set it’s value dynamically from the version field of the MetaData class. It is either set by hand, or drawn from some text file.
Is there a simple way to achieve what I want, in a way that it won’t be overwritten by the code generator?
Thanks in advance.
JLabelhas asetTextmethod that you should call in a place that you know for sure that won’t be overridden by the IDE.