scrollpane

JavaFX ScrollPane programmatically moving the viewport - centering content

有些话、适合烂在心里 提交于 2019-12-19 03:24:35
问题 I can use the setVvalue(double) and setHvalue(double) methods to move a viewport in a JavaFX ScrollPane. What I'm struggling to do is center a particular node in the content of the scroll pane based on its position. I've tried all sorts of combos of localToScene() and boundsInParent(). I've read (a lot) and seen this example How to scroll to make a Node within the content of a ScrollPane visible? Which is close but doesn't center the objects just puts them visible. Having the built in mouse

Custom design JScollPane Java Swing

僤鯓⒐⒋嵵緔 提交于 2019-12-17 10:31:14
问题 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 回答1: 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),

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

落花浮王杯 提交于 2019-12-17 09:51:13
问题 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

how do I add a JLabel to a specific location into my ScrollPane?

拥有回忆 提交于 2019-12-13 16:04:43
问题 Im trying to show images and/or labels in my JPanel. The thing is, I want to show many JLabels in custom locations but currently I can only show like 4 labels. I understand I need to use ScrollPane. I have tried using it but its not letting me alocate them with customs locations. (By custom locations I mean using coords to place my label.) Here is the code WITHOUT using ScrollPane: import java.awt.Dimension; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel;

How to handle oversized JDialog

岁酱吖の 提交于 2019-12-13 03:52:59
问题 I'm developing a JDialog which will have three sections, one on the top of the other: customer general information, list of customer addresses and list of orders. The list of customer addresses may grow arbitrarily large and this causes the dialog to grow beyond the screen height. Thus, calling pack() before displaying it does not work because the packed dialog height is still too big for the screen height. This calls for a scroll pane. But I would have to set the dialog's preferred size to

jquery scrollpane ms ajax updatepanel doesn’t work after post back

▼魔方 西西 提交于 2019-12-12 19:36:59
问题 I have received a new design for a website and in the design the designer used jquery. I'm implementing the design no into an ASP.NET Ajax application. But I ran into a problem. I have a page with an update panel and a menu. When a menu item is clicked a user control is loaded dynamically into a placeholder on the update panel. This makes that the page is not totally refreshed but only the update panel. Now the content in the user control contains a scrollpane that extends to the maximum

Incorrect JPanel position in GridBagLayout

自古美人都是妖i 提交于 2019-12-11 16:45:53
问题 im using GridBag to display some JPanels with images inside a JScrollPane. When there are 3 or more images the GridBagConstraints work ok but when i have 1 or 2, they get aligned to the center of the JScrollPane instead of being in their position in the top (like in a gallery) Here is my code: JPanel jPanel1 = new JPanel(); GridBagLayout layout = new GridBagLayout(); jPanel1.setLayout(layout); GridBagConstraints gbc = new GridBagConstraints(); JPanel photo = new JPanel(); Dimension d = new

JavaFX ScrollPane - How to use one scrollbar to scroll 2 ScrollPanes?

风流意气都作罢 提交于 2019-12-11 02:45:52
问题 I have BorderPane with left and center part, both are ScrollPanes. How to scroll them with one scrollbar ( vertical ). Or how to get access to one of the ScrollBars ? 回答1: you can bind scrollpane1(sp1) vScrollBar property and set the changed value to other scrollpane vScrollbar property. Sample code : this code automatically changes SP2 vScrollbar position when Sp1 vScrollbar position chnaged. DoubleProperty vPosition = new SimpleDoubleProperty(); vPosition.bind(sp1.vvalueProperty());

JavaFX ScrollPane - Check which components are displayed

ぃ、小莉子 提交于 2019-12-10 17:34:08
问题 I wonder whether there is a ScrollPane property in JavaFX 8 that can be used to listen on the components that are currently displayed at a given time. For example, ScrollPane has a VBox which has 8 buttons. Only 4 buttons can be seen in scrollpane. I would like a listener that gives those 4 out of 8 buttons that are displayed while the position of the scroll changes. 回答1: You can check if the Nodes visible like that: private List<Node> getVisibleNodes(ScrollPane pane) { List<Node>

How can I set the unit increment for a scroll pane in JavaFX?

守給你的承諾、 提交于 2019-12-10 12:57:23
问题 The ScrollBar class in JavaFX contains a property for setting the unit increment, which is what I'm after - however I can't find how to get at this ScrollBar, or set the unit increment some other way from the ScrollPane class! I presume I must be missing something obvious - how do I achieve this? 回答1: Technically, you should be able to get to it using the .lookup("scrollbar") method after the skin is initialized (if the scrollbar is visible). I don't like that answer though. I don't think you