I have a question. I am creating an application where an Arc length changes and I want that arc inside a borderpane, but when i change the length of the Arc it will get centered, so it doesn't look like a circle that's getting filled. Actually what i need is an arc and calculate it's position (the center of the borderpane) by it's maximum length (360). Can someone help me with this problem? Thank you very much.
JavaFX center an resizable arc in a borderpane
2.6k Views Asked by Gilian Joosen At
2
There are 2 best solutions below
4
Hami Torun
On
Inside BorderPane (or StackPane) the alignment is done according to the bounding box of the shape (top left, center, bottom etc.). Therefore the center point of the arc will move and will not give you the effect you want.
Instead, put the arc inside an AnchorPane (if you want to use BorderPane, put AnchorPane inside a region (left, right, center etc.) of the BorderPane). This will fix the center point of the arc even if you change the arc length and give you the effect of a circle getting filled with the increasing arc length.
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in JAVAFX
- JAVAFX error incompatible types: FXMLLoader cannot be converted to node
- How to resolve browser crash issue in JavaFX?
- JavaFX can't play mp3 files
- JavaFX 8 Load external FXML
- All my JavaFX TextFields have lines in them
- Javafx TableView with custom row color using CSS
- Java for Mobile and Desktop Development
- Create Dialogs with Default Images in JavaFX (Info/Warning/Error)
- In javaFx is it possible to make rounded corner of a Rectangle except right-bottom?
- using javafx 8 (java 8 install) How to extend Label.setTooltip Display time to 20secs (while mouse is inside Tooltip)
- javaFX : How to periodically load information from db and show it on a Label?
- How to enable right click option in JavaFX Pane?
- Using ReactFX to resize stage when nodes become invisible?
- How to change collapse and expand icon for a particular treeview in javafx?
- is it possible to set a javaFX Pane origin to bottom-left?
Related Questions in RESIZE
- How to resize images with PHP PARSE SDK
- Problems with Clickable Divs in side bar
- Resizing images failing on start, setContentView & bitmap factory[android]
- HTML, CSS | Page Blurs on resize
- A view that can be moved and resized on android
- Creating a vertically draggable container in Adobe Flex 3.5
- Resize <iframe> so that whole content just scales down or up
- How to resize a flexible text-area on a mobile device?
- Why is my array of struct not resizing with Array.Resize?
- Resize image to the size of JLabel taken dynamically from file chooser in Swing app
- Best way to resize top banner images (viewport/html)
- Python Resize Multiple images ask user to continue
- Resize flexlslider at the end of window resize
- Resize a UITableView
- Error on running "adb shell wm density 240" for changing Android device density
Related Questions in SHAPES
- ggplot2 shapes by variables with replicates
- PPT VBA: Capturing Screen Shot inside Shape
- Use XAML StringFormat to get one decimal place
- WPF: 2 string.format in the same TextBlock?
- CSS: Text-width based quadrilateral button
- How to make the arc corners go out not in with a Three.js Shape
- How to define custom shape, as click-able area for anchor tag? (cross-browser)
- Problems on Python Code using Theano
- Draw arbitrary convex shape knowing the lengths of its sides
- How to create a sphere in css?
- How to recognize the shape of traffic sign?
- How to create an indent in shaped control that allows painting on indented region?
- How to set background image on the right hand side of a shape in android
- Css shapes support in IE/Firefox
- Flash CS6/as3: Using cursor to draw rectangle dynamically in a published swf
Related Questions in BORDERPANE
- How to replace a scene component with a button click inJavaFX
- javafx-Replacing background image of a BorderPane
- How do I switch between layouts in Javax?
- Class 'javafx.scene.layout.BorderPane' does not support property 'controller'
- JavaFX - Centering BackgroundImage that covers BorderPane
- BorderPane setCenter overflow
- IndexOutOfBoundsException when BorderPane.setLeft
- JavaFX center an resizable arc in a borderpane
- Anchor Pane is null despite of being linked
- BorderPane.getCenter() literally gets the node from the center region of BorderPane
- Different sizes in JavaFX on different screens
- JavaFX ComboBox Dropdown Layout
- JavaFX BorderPane vs Pane hiding Labels
- Can't center nodes within a border pane
- JavaFX BorderPane set multiple buttons to Bottom?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Create a Group. Place a rectangle in the group which is the size of a full circle (e.g. the rectangle's height and width is set to the circle's diameter), then add the arc to the group, with the arc layout position set to the circle's radius. Place the Group in a StackPane so that the fixed size Group will be centered within a resizable Region. Place the StackPane in the center of your BorderPane. Set the minimum size of the StackPane to zero so that it can be sized smaller than the Group, keeping the Group centered and clipped within it's visible bounds. Add some controls to the bottom of the BorderPane so that you can control the length of the arc dynamically.