private void fillMap() {
this.getClass().getResourceAsStream("C:/Users/Emir/OneDrive/Documents/NewOne/LibraryManagementSystem/src/main/java/companyProperty");
prop.forEach((key, value) -> map.put(key.toString(), value.toString().split(",")));
map.
forEach((k, v
) -> System.
out.
println(k
+ ": " + Arrays.
toString(v
)));
}
public static void main
(String[] args
) {
launch(args);
}
@Override
public void start(Stage stage) {
fillMap();
stage.setTitle("ComboBoxSample");
Scene scene
= new Scene
(new Group());
final ComboBox<String> company = new ComboBox<>();
company.getItems().addAll(new ArrayList<>(map.keySet()));
final ComboBox<String> priorityComboBox = new ComboBox<>();
priorityComboBox.getItems().addAll(new ArrayList<>(map.keySet()));
/*company.setCellFactory(lv -> new ListCell<>() {
public void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
if (empty) {
setText(null);
} else {
setText(item);
switch (item) {
case "Automotive":
case "Engineering, various":
case "Electronics":
case "Pharmaceuticals":
case "Aerospace & Defense":
case "Chemicals":
case "Food & Beverages":
case "Steel":
setOpacity(0.5);
setDisable(true);
break;
default:
setOpacity(2);
setDisable(false);
}
}
}
});
company.valueProperty().addListener((ov, t, t1) -> {
char firstIDLetter = t1.toUpperCase().charAt(0);
char secondIDLetter = t1.toUpperCase().charAt(t1.length() - 1);
*//* System.out.println(ov);*//*
*//*System.out.println(t); Previous value *//*
System.out.printf("%s%s", firstIDLetter, secondIDLetter);
});*/
priorityComboBox.setValue("Normal");
company.setValue("Hydrotec Military Vehicles");
GridPane grid = new GridPane();
grid.setVgap(4);
grid.setHgap(10);
grid.
setPadding(new Insets(5,
5,
5,
5));
grid.
add(new Label("Companies: "),
0,
0);
grid.add(company, 1, 0);
grid.
add(new Label("Products: "),
0,
1);
grid.add(priorityComboBox, 1, 1);
/*grid.add(new Label("Subject: "), 0, 1);
grid.add(subject, 1, 1, 3, 1);*/
/* grid.add(text, 0, 2, 4, 1);*/
/* grid.add(button, 0, 3);*/
grid.setVgap(15);
/*grid.add(notification, 1, 3, 3, 1);*/
root.getChildren().add(grid);
stage.setScene(scene);
stage.show();
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}