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

x
?
Solved

Is this correct to add the wave files to this loop

Posted on 2004-04-25
4
Medium Priority
?
158 Views
Last Modified: 2010-03-31
Is this correct to add the wave files to this loop. Will there need to be a directory use here or anywhere?

b.setActionCommand("" + (i+1) "seconds" + ".wav");


for (int i=2; i<13; i++)
            {
               JButton b = new JColoredButton( Color.green, Color.black);
               b.setPreferredSize( new Dimension( 40, 20 ) );
               buttons.put("b"+(i+1), b);
               b.setText("" + (i+1) "seconds")
               b.addActionListener(this);
               gridPanel.add(b);
            }
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
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 800 total points
ID: 10914681
           for (int i=2; i<13; i++)
            {
               JButton b = new JColoredButton((i+1)+"seconds", Color.green, Color.black);
               b.setActionCommand((i+1)+"seconds" + ".wav");
               b.setPreferredSize( new Dimension( 40, 20 ) );
               buttons.put("b"+(i+1), b);
               b.addActionListener(this);
               gridPanel.add(b);
            }

Are all the files in the same directory?  If not then no real need to store the directory in the action command
0
 

Author Comment

by:Drop_of_Rain
ID: 10914699
What would you advise for could programing practices.
0
 
LVL 92

Expert Comment

by:objects
ID: 10914705
as is seems fine, and store all your wav's in a single dir
0
 

Author Comment

by:Drop_of_Rain
ID: 10914715
OK thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
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

670 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