Solved

sharing private members for two tabs

Posted on 2004-04-02
2
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
fibonacci ten numbers 4 54
Html Table Looping (part 2) 5 35
IBM TS2900 (3572) Tape Autoloader Java? 12 59
Java array 21 82
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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

749 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