scrollpane

JavaFX ScrollPane border and background

こ雲淡風輕ζ 提交于 2019-11-27 13:57:40
问题 I'm having some problem regarding the default background and border of the ScrollPane. Using this style made the problem clearer to see. setStyle("-fx-background-color:blue; -fx-border-color:crimson;"); I've tried this style and got no luck only the red border gone and left me with the blue one. setStyle("-fx-background-color:blue; -fx-background-insets:0; -fx-border-color:crimson; -fx-border-width:0; -fx-border-insets:0;"); I've looked at this old post JavaFX Hide ScrollPane gray border and

How to resize JavaFX ScrollPane content to fit current size

拈花ヽ惹草 提交于 2019-11-27 13:24:19
问题 I have a BorderPane with a ScrollPane as the center element. It resizes automatically to fill the screen. Inside the ScrollPane is a HBox that has no content but is a drag-and-drop target. Therefore I want it to fill its parent ScrollPane . What is the preferred way to do this? What I have tried so far is overriding the ScrollPane.resize(...) method to resize the HBox but it seems rather complicated and unorthodox. edit: To add some useful code to this, this is how I can workaround the

Custom design JScollPane Java Swing

拈花ヽ惹草 提交于 2019-11-27 11:51:09
I need to design this scrollbar for all my scrollpanes : With Java Swing. I am using Netbeans IDE. What is the simplest solution ? Thank you very much. Regards You can customize the look of a Swing component by setting a custom UI . In the case of a scroll pane's scroll bar, you do scrollPane.getVerticalScrollBar().setUI(new MyScrollBarUI()); where MyScrollBarUI is derived from javax.swing.plaf.basic.BasicScrollBarUI . To do this for all scroll bars (not only in JScrollPane instances), call UIManager.put("ScrollBarUI", "my.package.MyScrollBarUI"); before you create any Swing components. In

Java: How to draw non-scrolling overlay over ScrollPane Viewport?

早过忘川 提交于 2019-11-27 08:57:42
I'd like to use a ScrollPane to display an image in its Viewport, and also have a grid (or box, or any other type of registration/location marker) overlay on the image. I need the overlay to remain fixed when scrolling (meaning the image seems to move "under" the overlay). I will be scrolling the View in the Viewport at a fixed rate to provide a smooth motion, and the overlay is to provide a reference to a certain location within the Viewport. Conceptually, think of a large map scrolling in a Viewport, and the Viewport having a rectangle that does not move (relative to the Viewport itself)

JavaFx 8 - Scaling / zooming ScrollPane relative to mouse position

强颜欢笑 提交于 2019-11-27 03:37:57
问题 I need to zoom in / out on a scroll pane, relative to the mouse position. I currently achieve the zooming functionality by wrapping my content in a Group, and scaling the group itself. I create a new Scale object with a custom pivot. (Pivot is set to the mouse position) This works perfectly for where the Group's initial scale is 1.0, however scaling afterwards does not scale in the correct direction - I believe this is because the relative mouse position changes when the Group has been scaled