Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

More checkboxs using the same code

Posted on 2004-04-09
6
Medium Priority
?
194 Views
Last Modified: 2010-03-31
Hello everyone out there hope all is going well.

I have 50 checkboxs named (kp1-kp50) these checkboxs are in a seperate JPanel named KP'S, In another JPanel next to it is another 50 checkboxs named (dm1-dm50) and others with names (kk1-kk20) and so on.

How could I use the code below to work with all of these checkboxs going in both directions
(IN (checkToAudio.put(cb, af)) and Out((AudioFile)return checkToAudio.get(cb))



public class CheckBoxesToAudioFiles {
Map checkToAudio;

public CheckBoxesToAudioFiles {
checkToAudio = new HashMap();
}

public void mapCheckboxToAudioFile(JCheckbox cb, AudioFile af) {
checkToAudio.put(cb, af);
}

public AudioFile getAudioFileForCheckbox(JCheckbox cb) {
(AudioFile)return checkToAudio.get(cb);
}

}
0
Comment
Question by:Drop_of_Rain
[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
  • 4
  • 2
6 Comments
 

Author Comment

by:Drop_of_Rain
ID: 10793971
The reason I am asking this is because I might go in either direction. If you have seen any of my other questions.
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 10794837
You can use the one instance of CheckBoxesToAudioFiles for all your checkboxes regardless of what panel they are in.
Though if you are storing the audio file names as the checkbox action command then the CheckBoxesToAudioFiles class is not really necessary.
0
 

Author Comment

by:Drop_of_Rain
ID: 10794913
I am going to have to have this be possible both ways. The reason is that a user will be able to choose which option(checkbox) they want in their workout.  If I have this be possible won;t the checkboxs need to be toggles. I say this because if a user chooses 1 option three times (example 1,4,5,1,3,2,1) the checkbox will become unchecked and then checked but only seeing it twice.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 92

Expert Comment

by:objects
ID: 10794930
how do you want the checkbox to worlk exactly?
0
 

Author Comment

by:Drop_of_Rain
ID: 10794942
I now realize that I am going to have 2 differt setups. 1 will be checkboxs and the other will be toggles.
0
 

Author Comment

by:Drop_of_Rain
ID: 10796156
Thanks again.

Christopher
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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.
Suggested Courses

715 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