Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ve-dev] Labels no longer get()'ing

Hi all,

I was wondering why labels (JLabels) suddenly changed from a get()
paradigm to a non-global field.  Until recently, JLabels were created as
follows:

public JLabel getJLabel() {
	if(jLabel == null) {
		//blahblahblah
	}
	return jLabel;
}

// ..... and somewhere further down

public void initialize() {
	// ...
	blahblah.add(getJLabel());
	// ...
}

Right now, JLabels are created within the scope of its creator:

public void initialize() {
	JLabel jLabel = new JLabel();
	// ... customize jLabel
	blahblah.add(getJLabel());
}

Why did this change happen suddenly?  Is there a way to revert back to
the old style?  I'm kind of in favor of the old style, since I had some
dynamically changing labels.  get()'ing the label, then setText()'ing on
it was a piece of cake - now I have to globalize it (create a field in
the class), then change some parts of the code below.  Any reason for
this change?  Thanks in advance!

Lewis





Back to the top