sandeep
sandeep

Reputation: 95

displaying foreign languages in javafx choicebox dropdown

in my javafx choice-box drop down, i can't display a foreign language(mainly Malayalam) in that.it denotes foreign language as just square.

can any one provide a solution for this problem?

Upvotes: 1

Views: 508

Answers (2)

jewelsea
jewelsea

Reputation: 159546

I tried displaying Malayalam in a ChoiceBox in Java 8 (build 124) on OS X 10.8 and it worked fine for me, well as far as I can tell . . . I can't actually read it :-)

maya

import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.ChoiceBox;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class Maya extends Application {
    @Override
    public void start(Stage stage) {
        ChoiceBox<String> choices = new ChoiceBox<>(
            FXCollections.observableArrayList(
                "കേരളംകേരളം",
                "വ്യഞ്ജനം",
                "വട്ടെഴുത്ത്"
            )
        );
        choices.getSelectionModel().select(1);
        choices.setStyle("-fx-font-size: 20px");

        StackPane pane = new StackPane(
            choices
        );
        pane.setPadding(new Insets(10));
        stage.setScene(new Scene(pane));
        stage.show();
    }

    public static void main(String[] args) {
        launch();
    }   
}

Upvotes: 1

ItachiUchiha
ItachiUchiha

Reputation: 36782

You must go through how to locales in your application first. Please go through the link

http://docs.oracle.com/javafx/2/release_notes_2-2-4/jfxpub-release_notes_2-2-4.htm#A1117496

I am not sure if Malayalam is Bidirectional language like urdu or arabic, if it is than JavaFX 2+ doesn't support it. You will have to migrate to javafx8 for it !

See the following JIRA for more

https://javafx-jira.kenai.com/browse/RT-17411

Upvotes: 1

Related Questions