• 大小: 160KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-03
  • 语言: Java
  • 标签: Head-First-J  

资源简介

包含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  2018-07-22 19:55  Head-First-Java\
     目录           0  2018-07-22 19:52  Head-First-Java\AppendixA\
     文件         911  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal$MyDownTempoListener.class
     文件        1412  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal$MyListSelectionListener.class
     文件        1959  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal$MySendListener.class
     文件         712  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal$MyStartListener.class
     文件         785  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal$MyStopListener.class
     文件         905  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal$MyUpTempoListener.class
     文件        1746  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal$RemoteReader.class
     文件        8885  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal.class
     文件       10954  2015-07-17 01:44  Head-First-Java\AppendixA\BeatBoxFinal.java
     文件        1402  2015-07-17 01:44  Head-First-Java\AppendixA\MusicServer$ClientHandler.class
     文件        2120  2015-07-17 01:44  Head-First-Java\AppendixA\MusicServer.class
     文件        2102  2015-07-17 01:44  Head-First-Java\AppendixA\MusicServer.java
     目录           0  2018-07-22 19:52  Head-First-Java\chap01\
     文件         957  2015-07-17 01:44  Head-First-Java\chap01\BeerSong.class
     文件         861  2015-07-17 01:44  Head-First-Java\chap01\BeerSong.java
     文件        1673  2015-07-17 01:44  Head-First-Java\chap01\PhraseOMatic.class
     文件        1307  2015-07-17 01:44  Head-First-Java\chap01\PhraseOMatic.java
     目录           0  2018-07-22 19:52  Head-First-Java\chap02\
     文件         496  2015-07-17 01:44  Head-First-Java\chap02\GameLauncher.class
     文件         175  2015-07-17 01:44  Head-First-Java\chap02\GameLauncher.java
     文件        1806  2015-07-17 01:44  Head-First-Java\chap02\GuessGame.class
     文件        1884  2015-07-17 01:44  Head-First-Java\chap02\GuessGame.java
     文件         746  2015-07-17 01:44  Head-First-Java\chap02\Player.class
     文件         206  2015-07-17 01:44  Head-First-Java\chap02\Player.java
     目录           0  2018-07-22 19:52  Head-First-Java\chap03\
     文件        1343  2015-07-17 01:44  Head-First-Java\chap03\Dog.class
     文件         802  2015-07-17 01:44  Head-First-Java\chap03\Dog.java
     目录           0  2018-07-22 19:52  Head-First-Java\chap04\
     文件         354  2015-07-17 01:44  Head-First-Java\chap04\Foo.class
............此处省略158个文件信息

评论

共有 条评论