Hey guys,

I'm trying to develop a simple tool. I'm having but I'm having trouble accessing some swing components.

My gui basically has a jtabbed pane with two, jbuttons beneath it. Each tab is identical except for the title, it has a jtextarea and two jbuttons. These buttons perform an action on the jtextarea of the tab. The two buttons I mentioned earlier(the ones not in the jtabbed area) perform the same action to every jtextarea on each tab.

This is all built in one class. The tabs are created in a method, using a loop I create x amount of tabs(it's important that it's variable).
I am having trouble figuring out how to perform actions on the jtextareas in each tab? Should I be creating a reference arraylist or something? Or is my design poor? Should I possibly create a new class in which I build the tabs?

Recommended Answers

All 2 Replies

If the variables are defined as class variables, all methods in the class should be able to access them.

its better you post the code on what you have done so far so that we would be able to help based on that

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.