I have an image in the anchor area. but i can't resize this image when resizing a window. and do not understand why I can not change this property to view images
Related
I'm trying to make an imageview fit the size of its container (in my case a Pane), and at the same time place it in the center of the Pane in JavaFx, in detail I can't do both at the same time i can get it to fit the container, but not put it in the center.
here is the code i use to make it fit in the container Pane
//imgContainer is the pane that contains the image
//photo is my imageview
photo.fitWidthProperty().bind(imgContainer.widthProperty());
photo.fitHeightProperty().bind(imgContainer.heightProperty());
photo.setImage(new Image(post.getPhoto()));
this is the output that is produced, the photo adapts to the Pane dimensions, but it is located to the left of the container(the dark background is the Pane container) would to put it in the center of the pane and i couldn't find a method to do it keeping the dimensions of the Pane for the imageview, putting it on a hbox or stackPane allows to put it in the center but the image no longer keeps the container sizes well, so i don't know how to get it centered and fits the container at the same time
My app uses a frameless window and I made a custom title bar along with it, I set the entire titlebar area to be draggable with -webkit-app-region: drag; so you can position the window on the desktop, but now I can't resize the app from those corners, is there any way to keep both?
Edit: I added -webkit-app-region: drag; to the buttons and the left title area because I lost control of the buttons and I can resize from corners and those edges, but the top edge is still inactive
I have a ImageView with a transparent image (PNG) therefore the image doesn't fill the complete rectangle of the image view, when mouse hover over the image view I want to change the background color of only the rectangle of the image view. In Css how I do it? do the image view node have the property -fx-background color? I tried and it's doesn't work for me.
I have a css file linked to the .FXML
Use this
Bounds bound = ImageView.getBoundsInLocal(); //getting co-ordinates
ImageView.setEffect(ColorInput(bound.getMinX(), bound.getMinY(),
bound.getWidth(), bound.getHeight(), Color.YELLOW));
By function should work.
I have a HTML editor in a Pane container 355px in width. The editor gets cut on the right side where the width overlaps the containing pane. How can I set the HTML Editor's width to a smaller width than that of the parent container?
Please note that I'm on JavaFx SceneBuilder 2 and dragging the width to something smaller than that of the Parent container just doesn't work.
While on Scene Builder 2.0 the HTML editor can't be resized, this just affects the preview (well, maybe it hiddens some other controls,...). If this is really a problem, instead of adding the HTML editor there, just place a container with a proper fx:id and later on the controller add the editor as a child of that container.
Assuming you have the editor added on your FXML, and the width of your scene is 355px, as you say, the first preview of the application will have the toolbars cut, and there won't be any overflow button until you resize the window. Only then, the toolbars will be resized and the overflows will appear.
To overcome this problems and let the editor be resized right after the application is launched, without the manual resize, the workaround is to find the toolbars of the editor, and resize them.
#FXML private HTMLEditor htmlEditor;
#Override
public void initialize(URL url, ResourceBundle rb) {
Platform.runLater(()->{
htmlEditor.lookupAll("ToolBar")
.forEach(node->((ToolBar)node).setPrefWidth(355));
});
}
Note the hardcoded width value, for the sake of simplicity.
I Like to show a label that having a animated gif image over a listwidget.
listwidget is in a horizontal widget. when i am trying to put that label on window it aligned horizontally to list widget. I want to show it over the Listwidget with transparent view.
QMovie *m= new QMovie("loadingImage.gif");
QLabel *l=new QLabel();
ui.mainlayout->add
l->setMovie(m);
m->start();
l->show();
Don’t add the transparent widget to the layout. Just set the window as the transparent widget’s parent then show the widget. You’re then responsible for positioning and resizing the transparent widget to cover the list widget.