Skip to content

Instantly share code, notes, and snippets.

@amgaweda
Last active May 19, 2016 21:26
Show Gist options
  • Save amgaweda/b1e3c01d38a5afbc8b4ccec6426d83cf to your computer and use it in GitHub Desktop.
Save amgaweda/b1e3c01d38a5afbc8b4ccec6426d83cf to your computer and use it in GitHub Desktop.
Unicode Display
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class UnicodeDisplay extends Application {
@Override
public void start(Stage stage) throws Exception {
StackPane pane = new StackPane();
Text unicode = new Text("\u30C4");
Font f = new Font(100);
unicode.setFont(f);
// This WILL display the Unicode
pane.getChildren().add(unicode);
Scene scene = new Scene(pane, 500, 500);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
System.out.println("This will not display the character - \u30C4");
launch(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment