当我启动 javafx 窗口和 sphinx 应用程序时,我遇到了一些错误,如果我先运行 sphinx 然后启动窗口,程序不会记录任何命令,只有当我关闭窗口时,如果我先启动窗口 sphinx像往常一样记录,但会挡住窗口。
我的窗口:
public class Escolha extends Application{
private static final Image FOTOPROXY = new Image(Escolha.class.getResourceAsStream("/foto/proxy.png"));
private static final Font Corleone = Font.loadFont(Escolha.class.getResourceAsStream("/fontes/corleone.ttf"), 20);
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
init(primaryStage);
primaryStage.show();
}
public void init(final Stage primaryStage) {
//primaryStage.setScene(new Scene(addBorda()));
Group root = new Group();
primaryStage.setScene(new Scene(root));
HBox hboxImagem = new HBox();
hboxImagem.setPadding(new Insets(5, 5, 5, 25));
hboxImagem.setSpacing(10);
hboxImagem.setStyle("-fx-background-color: #b3ccff");
ImageView imagem = new ImageView(FOTOPROXY);
imagem.setFitHeight(200);
imagem.setFitWidth(550);
hboxImagem.getChildren().add(imagem);
HBox hboxTexto = new HBox();
hboxTexto.setPadding(new Insets(15, 5, 15, 15));
hboxTexto.setSpacing(10);
hboxTexto.setTranslateY(210);
hboxTexto.setStyle("-fx-border-style: solid;" + "-fx-border-width: 4;" +
"-fx-border-color: #99b3ff");
HBox hboxBotoes = new HBox();
hboxBotoes.setPadding(new Insets(35, 1, 1, -20));
hboxBotoes.setSpacing(10);
Text texto = new Text("Caso possua proxy é necessário configura-lo antes de executar a Olivia,\n" +
"você deseja configurar agora?");
texto.setFont(Corleone);
EventHandler<ActionEvent> vaiSim = new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
Configuracao.configurarProxy();
}
};
Button sim = new Button("Sim");
sim.setStyle("-fx-base: #b3ccff");
sim.setOnAction(vaiSim);
EventHandler<ActionEvent> vaiNao = new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
HelloWorld.RecDeVoz();
}
};
Button nao = new Button("Não");
nao.setStyle("-fx-base: #b3ccff");
nao.setOnAction(vaiNao);
hboxBotoes.getChildren().addAll(sim, nao);
hboxTexto.getChildren().addAll(texto, hboxBotoes);
root.getChildren().addAll(hboxImagem, hboxTexto);
}