Jump to content

How to pass a JLabel array from class A to class B?


Nanoic

Recommended Posts

Depends on what your classes A and B are, and what you mean by "pass"

 

Passing it?

B.whatever(jlabelArray);

is the actual passing, with whatever being a method with a JLabel[] param.

 

I assume you mean attach to B, which is some form of frame, container, or somesuch?

Just use .add() with the jlabels.

e.g. for (JLabel jlabelparam : jlabels) { this.add(jlabelparam); }

 

You'll have to elaborate some more on what problem you are encountering / what exactly you want to do if you want more details.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...