Skip to content

Instantly share code, notes, and snippets.

@penut85420
Created July 26, 2018 14:55
Show Gist options
  • Save penut85420/52163f12c7f3a38cebe9200b7c861abc to your computer and use it in GitHub Desktop.
Save penut85420/52163f12c7f3a38cebe9200b7c861abc to your computer and use it in GitHub Desktop.
package ntou.ws.ui;
import javafx.application.Application;
import javafx.geometry.*;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
public class SegmentorApp extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Word Segmentor");
Label t1 = new Label("Input Folder :");
Label t2 = new Label("Output Folder: ");
TextField inputPath = new TextField();
TextField outputPath = new TextField();
Button btnInput = new Button("Input");
Button btnOutput = new Button("Output");
Button btnWordSeg = new Button("Word Segmentation");
t1.setPrefWidth(90);
t2.setPrefWidth(90);
inputPath.setMaxWidth(99999);
btnInput.setPrefWidth(65);
btnOutput.setPrefWidth(65);
btnWordSeg.setPadding(new Insets(25));
BorderPane hb1 = new BorderPane();
hb1.setLeft(t1);
hb1.setCenter(inputPath);
hb1.setRight(btnInput);
BorderPane.setAlignment(t1, Pos.CENTER);
BorderPane.setMargin(btnInput, new Insets(10));
BorderPane hb2 = new BorderPane();
hb2.setLeft(t2);
hb2.setCenter(outputPath);
hb2.setRight(btnOutput);
BorderPane.setAlignment(t2, Pos.CENTER);
BorderPane.setMargin(btnOutput, new Insets(10));
VBox vb = new VBox(20);
vb.setPadding(new Insets(10, 10, 20, 10));
vb.setAlignment(Pos.CENTER);
vb.getChildren().add(hb1);
vb.getChildren().add(hb2);
vb.getChildren().add(btnWordSeg);
VBox.setVgrow(hb1, Priority.NEVER);
VBox.setVgrow(hb1, Priority.NEVER);
Scene scene = new Scene(vb, 400, 225);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
SegmentorApp.launch(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment