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

x
?
Solved

change code to fork with buttons instead of checkboxs

Posted on 2004-04-10
4
Medium Priority
?
188 Views
Last Modified: 2010-03-31
How would this code be modified to work with buttons instead of checkboxs?



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
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Javatm earned 1000 total points
ID: 10799123
I've re-named some things :

public class ButtonsToAudioFiles {
  Map checkToAudio;

  public ButtonsToAudioFiles {
  checkToAudio = new HashMap();
  }

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

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

Hope that helps . . .
Javatm
0
 
LVL 92

Expert Comment

by:objects
ID: 10799136
Do you even need that class at all, what do you currently use it for?
0
 

Author Comment

by:Drop_of_Rain
ID: 10799515
objects, I will be using this class in the custom section of the program. Yes I need it.
0
 
LVL 15

Expert Comment

by:Javatm
ID: 10799898
http://javatm.4t.com

Always glad to help . . .
Friend : Javatm
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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Suggested Courses

705 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