【发布时间】:2013-12-08 10:14:40
【问题描述】:
Playjb.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e)
{
try {
InputStream in;
Path = rs.getString("Path");
in = new FileInputStream(new File(Path));
AudioStream audios=new AudioStream(in);
AudioPlayer.player.start(audios);
System.out.println("play");
//here I want to add somthing that sets the OKjb
//(another JButton) inactive until the audio is finished.//
}catch(exception e){
}
【问题讨论】:
-
放入
SwingWorker,在done()方法中启用按钮。 -
对不起,我没听懂。请你写下来好吗?
-
@user3026191 如果对您有帮助,请考虑接受答案或要求更多说明。
标签: java swing audio jbutton wait