Page 2 of 2 FirstFirst 12
Results 21 to 33 of 33
  1. #21
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default finding stuff in the closet

    Quote Originally Posted by carderne View Post
    ..."keying the list on"
    What does that mean?
    One has to program in such a way that an uninformed user can find a title, no? Or maybe album name or whatever. Someone goes to the juke box, selects Orpheus Orwell, Sonata Slick, so how do we get that song from the list? The title of the song is not the song, thus, one has to retireve Slick from the list. But Slick is the name, not the song. So we have to arrive at a manner of getting the data for the song. If all of the list is songs, and user types in Slick at the keyboard: Where's the notes for the song?

    It is tricky at first, but not really hard. There are several ways of doing it.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  2. #22
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    7

    Default

    Thanks fishtop. That's what I was kind of heading towards, but I couldn't quite squeeze it out. I'll give that a try this weekend.

    @Nicholas
    Ok, that clears it up a bit for me, but I'm still not 100% certain, so I'll read up a bit.

  3. #23
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    7

    Default

    Great! I've put fishtop's recommendation to use. Instead of using the toArray() method, I've just used the get() method with a for loop to turn it into an array of Strings for display. Thanks very much everyone for your help.

  4. #24
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default simple map

    Quote Originally Posted by carderne View Post
    Ok, that clears it up a bit for me, but I'm still not 100% certain, so I'll read up a bit.
    Java Code:
    public class TitleToSong
    {
        private String[] titles;
        private Map musicForTitles;// have to import java.util. ( whichever map you use )
        public TitleToSong(String[] titlesFromSomeplace)
        {
            musicForTitles = new TreeMap();
            // Not sure of this syntax, I do it the 1.2 way.
            for(String aTitle : titlesFromSomeplace)
            {
                musicForTitles.add(aTitle, new MusicalContent);
    This is lacking even a first effort at finding the actual coding, the variable names are to help you know what to look for.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  5. #25
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    7

    Default

    Ok, thanks again. As before, I'll only be able to try this out next weekend...

  6. #26
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    7

    Default

    I got the ArrayList stuff working pretty nicely. I'm having to recode huge portions of the program to get it all running, but it'll be better once I'm done.

    I'll try Nicholas's suggestion on Sunday.

    Another question:
    If you were to give you the directory of an mp3 file, eg: "C:\song.mp3"
    Is there an easy way that you can get this to play in Java? I don't need a seek bar or anything, just a simple output of sound...

  7. #27
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    There are several ways to do it, but you have to have either what is called a shell link, or someone smart enought to install and launch java. We have another poster in Spain who has been working on this, the posts run several thousand questions spanning several months so it's not really all that hard for a coder.

    Are you a coder or a musician?...If you are a musician, probably join willemjav in his effort.

    ( humor folks, humor )
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  8. #28
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    7

    Default

    So based on my knowledge and ability of java, do you think I'll manage?

  9. #29
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    Yes, you are ahead of the guy in Spain already.

    consider:
    Java Code:
    MusicObject mo = ( MusicObject ) ArrayList.getItem(number_index);
    Which is where ftr's advice will go.

    You could as well require a nickel to get items out of the array list......
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  10. #30
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    7

    Default

    Hehe, maybe if I ask nicely a nickel won't be necessary.

  11. #31
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    7

    Default

    Another question:
    I have a little search box, and after you've typed in a word, you click a "go" button next to it. I'm using Netbeans, so how can I make it so that the Enter button makes it search?

  12. #32
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    7

    Default

    Ok, thanks for the help. Everything solved and sorted. Mods can close.

  13. #33
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Smile mark as solved

    Quote Originally Posted by carderne View Post
    Ok, thanks for the help. Everything solved and sorted. Mods can close.
    better if you mark as solved using:
    Java Code:
    View First Unread - LinkBack - Thread Tools - Search this Thread - Rate Thread - Display Modes
    at navigation bar in the ui
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [SOLVED] Reading a text file into an Array
    By DonCash in forum New To Java
    Replies: 13
    Last Post: 01-25-2011, 12:51 AM
  2. count character in text file as input file
    By aNNuur in forum New To Java
    Replies: 7
    Last Post: 03-25-2010, 04:01 PM
  3. Replies: 3
    Last Post: 08-05-2008, 03:19 AM
  4. problem with the way to export data to CSV file
    By gonne in forum Java Servlet
    Replies: 0
    Last Post: 07-01-2007, 02:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •