Solved

change code to fork with buttons instead of checkboxs

Posted on 2004-04-10
4
185 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 250 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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 the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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

759 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