
I want to design one application with a combobox containing items. and while selecting i want to give user autocomplete suggestion. but while doing this combobox is not getting resolved. i have attached the files.
Ademo.fxml
<AnchorPane prefHeight="268.0" prefWidth="290.0" xmlns:fx="http://javafx.com/fxml" fx:controller="v.C_hgj">
package v;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class V_hgj extends Application{
public static void main(String[] args) {
launch(V_hgj.class, (java.lang.String[])null);
}
@Override
public void start(Stage primaryStage) throws Exception {
try
{
//loading .fxml file
AnchorPane ap=FXMLLoader.load(V_hgj.class.getResource("Ademo.fxml"));
Scene sc=new Scene(ap);
primaryStage.setScene(sc);
primaryStage.setTitle("Product");
//getting external .css file
// primaryStage.getScene().getStylesheets().add("file:/~/helper/gui.css");
primaryStage.show();
}
catch(Exception ex)
{
Logger.getLogger(V_product.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
C_hgj.java
package v;
import java.net.URL; import java.util.ResourceBundle;
import javafx.fxml.FXML; import javafx.fxml.Initializable;
public class C_hgj implements Initializable{
@FXML
private ComboBox fruitCombo;
public static void main(String[] args) {
// TODO Auto-generated method stub
}
@Override
public void initialize(URL location, ResourceBundle resources) {
// TODO Auto-generated method stub
assert fruitCombo!=null : "reset botton not injected";
}
} please help ....
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.