• 大小: 160KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: Java
  • 标签: Head  first  java  

资源简介

Head first java 源码完整版

资源截图

代码片段和文件信息

package AppendixA;
// chapter 14

import java.awt.*;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

import java.io.*;
import javax.sound.midi.*;
import java.util.*;
import java.awt.event.*;
import java.net.*;


public class BeatBoxFinal {  // implements metaEventListener 

      JPanel mainPanel;
      JList incomingList;
      JTextField userMessage;
      ArrayList checkboxList;
      int nextNum;
      objectInputStream in;
      objectOutputStream out;
      Vector listVector = new Vector();
      String userName ;
      HashMap otherSeqsMap = new HashMap();
      Sequencer sequencer;
      Sequence sequence;
      Sequence mySequence = null;
      Track track;
      Jframe theframe;

      String[] instrumentNames = {“Bass Drum“ “Closed Hi-Hat“ 
         “Open Hi-Hat““Acoustic Snare“ “Crash Cymbal“ “Hand Clap“ 
         “High Tom“ “Hi Bongo“ “Maracas“ “Whistle“ “Low Conga“ 
         “Cowbell“ “Vibraslap“ “Low-mid Tom“ “High Agogo“ 
         “Open Hi Conga“};
      int[] instruments = {35424638493950607072645658476763};
    

      public static void main (String[] args) {
        new BeatBoxFinal().startUp(args[0]);
      }
      
      public void startUp(String name) {
          userName = name;
          try {
              Socket sock = new Socket(“127.0.0.1“ 4242);
              out = new objectOutputStream(sock.getOutputStream());
              in = new objectInputStream(sock.getInputStream());
              Thread remote = new Thread(new RemoteReader());
              remote.start();
          }
          catch (Exception ex) {
              System.out.println(“couldn‘t connect - you‘ll have to play alone.“);
          }
          setUpMidi();
          buildGUI();
      }

      public void buildGUI() {
          theframe = new Jframe(“Cyber BeatBox“);
          theframe.setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
          BorderLayout layout = new BorderLayout();
          JPanel background = new JPanel(layout);
          background.setBorder(BorderFactory.createEmptyBorder(10101010));

          checkboxList = new ArrayList();
          Box buttonBox = new Box(BoxLayout.Y_AXIS);

          JButton start = new JButton(“Start“);
          start.addActionListener(new MyStartListener());
          buttonBox.add(start);
          
          
          JButton stop = new JButton(“Stop“);
          stop.addActionListener(new MyStopListener());
          buttonBox.add(stop);

          JButton upTempo = new JButton(“Tempo Up“);
          upTempo.addActionListener(new MyUpTempoListener());
          buttonBox.add(upTempo);

           JButton downTempo = new JButton(“Tempo Down“);
          downTempo.addActionListener(new MyDownTempoListener());
          buttonBox.add(downTe

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-07-16 17:44  Head-First-Java-master\
     目录           0  2015-07-16 17:44  Head-First-Java-master\AppendixA\
     文件         911  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal$MyDownTempoListener.class
     文件        1412  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal$MyListSelectionListener.class
     文件        1959  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal$MySendListener.class
     文件         712  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal$MyStartListener.class
     文件         785  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal$MyStopListener.class
     文件         905  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal$MyUpTempoListener.class
     文件        1746  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal$RemoteReader.class
     文件        8885  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal.class
     文件       10954  2015-07-16 17:44  Head-First-Java-master\AppendixA\BeatBoxFinal.java
     文件        1402  2015-07-16 17:44  Head-First-Java-master\AppendixA\MusicServer$ClientHandler.class
     文件        2120  2015-07-16 17:44  Head-First-Java-master\AppendixA\MusicServer.class
     文件        2102  2015-07-16 17:44  Head-First-Java-master\AppendixA\MusicServer.java
     文件          43  2015-07-16 17:44  Head-First-Java-master\README.md
     目录           0  2015-07-16 17:44  Head-First-Java-master\chap01\
     文件         957  2015-07-16 17:44  Head-First-Java-master\chap01\BeerSong.class
     文件         861  2015-07-16 17:44  Head-First-Java-master\chap01\BeerSong.java
     文件        1673  2015-07-16 17:44  Head-First-Java-master\chap01\PhraseOMatic.class
     文件        1307  2015-07-16 17:44  Head-First-Java-master\chap01\PhraseOMatic.java
     目录           0  2015-07-16 17:44  Head-First-Java-master\chap02\
     文件         496  2015-07-16 17:44  Head-First-Java-master\chap02\GameLauncher.class
     文件         175  2015-07-16 17:44  Head-First-Java-master\chap02\GameLauncher.java
     文件        1806  2015-07-16 17:44  Head-First-Java-master\chap02\GuessGame.class
     文件        1884  2015-07-16 17:44  Head-First-Java-master\chap02\GuessGame.java
     文件         746  2015-07-16 17:44  Head-First-Java-master\chap02\Player.class
     文件         206  2015-07-16 17:44  Head-First-Java-master\chap02\Player.java
     目录           0  2015-07-16 17:44  Head-First-Java-master\chap03\
     文件        1343  2015-07-16 17:44  Head-First-Java-master\chap03\Dog.class
     文件         802  2015-07-16 17:44  Head-First-Java-master\chap03\Dog.java
     目录           0  2015-07-16 17:44  Head-First-Java-master\chap04\
............此处省略159个文件信息

评论

共有 条评论