Solved

sharing private members for two tabs

Posted on 2004-04-02
2
147 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
ID: 10742597
Make sure the checkbox really is shared
0
 
LVL 16

Accepted Solution

by:
warturtle earned 50 total points
ID: 10749576
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
custom annotations 9 42
hibernate example for saving data 19 52
Tomcat: Unable to run tomcat service. 2 23
Which non-HTML GUI front end to use with Java? 3 24
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

766 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