Nanoic Posted March 23, 2017 Share Posted March 23, 2017 How to pass a JLabel array from class A to class B? Link to post Share on other sites
Dreamer23 Posted March 23, 2017 Share Posted March 23, 2017 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.