Solved

sharing private members for two tabs

Posted on 2004-04-02
2
144 Views
Last Modified: 2010-03-31
hi!

I have JTabbedpane with 6 tabs and two of them, I am sharing same labels, testfields, checkbox and button as private members. I also use same actionPerformed(ActionEvent e) for two tabs; however, one of checkbox's behavior works from one tab and the other doesn't work.

Is it because I am sharing private members for those tabs?
0
Comment
Question by:dkim18
2 Comments
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
Make sure the checkbox really is shared
0
 
LVL 16

Accepted Solution

by:
warturtle earned 50 total points
Comment Utility
Hi,

In case, you are interested in sharing behaviour, then do this:

private static JCheckBox check ;

Declare them static, in this way, they will share the behaviour, and hopefully, this should resolve the problem.

Best Regards,

Warturtle
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now