我有一个边框窗格,其顶部,左侧和右侧有组件.我想通过鼠标事件使用borderPane的id删除其右侧的组件.我怎么做?
单击“注册”按钮后,我想打开一个弹出对话框。我想在弹出对话框中添加诸如文本字段,密码字段之类的元素。如果您可以建议我如何将组件添加到弹出窗口,然后将弹出窗口添加到窗格并显示它,那就更好了。谢谢!。
我已经使用scenebuilder为javafx构建了我的应用程序.我有一个人必须上传图像的表格.我用过这段代码
public void photoChooser(ActionEvent evt) {
System.out.println("photoChooser method is called");
try{
FileChooser fileChooser= new FileChooser();
fileChooser.setTitle("Choose a file");
File file = fileChooser.showOpenDialog(stagehere);
if(file != null){
System.out.println(file);
String img = file.toString();
//Image image = new ImageIcon(img);
try{
// image= new Image();
Image image = new Image(img);
} catch (Exception e) {System.out.println("Can't upload image " + e);}
//employeeImage.setImage(image);
try{
// employeeImage.setImage(image);
} catch(Exception e){System.out.println("Can't set the image" + e);}
employeeImage.setFitWidth(150);
employeeImage.setFitHeight(150);
}
Run Code Online (Sandbox Code Playgroud)
我收到了这个错误
photoChooser method is called
A:\images\fb\status\asd.jpg
Can't upload image java.lang.IllegalArgumentException: …