为了账号安全,请及时绑定邮箱和手机立即绑定

同一程序,在eclipse中可以运行,cmd命令行运行却编译不过

同一程序,在eclipse中可以运行,cmd命令行运行却编译不过

嘟嘟的啦 2016-10-11 17:15:40
报错部分代码如下:public class BeatBox { JPanel mainPanel; ArrayList<JCheckBox> checkboxList; Sequencer sequencer; Sequence sequence; 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"}; //实际的乐器关键字,例如说35是Bass Drum,42是Closed Hi-Hat int[] instruments = {35, 42, 46, 38, 49, 39, 50, 60, 70, 72, 64, 56, 58, 47, 67, 63}; public static void main(String[] args) { new BeatBox().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(10, 10, 10, 10)); checkboxList = new ArrayList<JCheckBox>(); 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);
查看完整描述

2 回答

?
JustWannaHugU

TA贡献452条经验 获得超796个赞

八成是构造方法的事情

你这代码贴的,一个字 眼花缭乱

查看完整回答
反对 回复 2016-10-11
?
ziom

TA贡献948条经验 获得超1109个赞

IDE里运行的好好的,为什么要自找麻烦去命令行运行。。。

查看完整回答
反对 回复 2016-10-11
  • 2 回答
  • 0 关注
  • 2058 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信