💠 Undecorated JavaFX Scene with implemented move, resize, minimise, maximise, close and Windows Aero Snap controls.

Overview

AlexKent Support me joining PI Network app with invitation code AlexKent AlexKent


FX-BorderlessScene ( Library )

💠

Undecorated JavaFX Scene with implemented move, resize, minimise, maximise, close and Windows Aero Snap controls. Implement any style you want for your JavaFX application using custom css or default .


Latest Version GitHub contributors HitCount Total Downloads

java_2019-04-30_17-43-54

Donate if you love me

Patreon donate button PayPal donate button

Features

  • Done ✔️
    • Implemented drag and move
    • resize, minimise, maximise, close
    • Windows Aero Snap controls.
    • Styling Aero Snap window
    • Styling Main window
  • TODO 🚧
    • Multiple Screens Support
    • Fix lagging on resizing

This project has been forked and further developed from this github repository

Use it with Maven , Gradle etc ... with

https://jitpack.io/#goxr3plus/FX-BorderlessScene

Add JitPack on your repositories :

<repositories>
   <repository>
     <id>jitpack.io</id>
     <url>https://jitpack.io</url>
   </repository>
</repositories>

Add the dependency :

<dependency>
  <groupId>com.github.goxr3plus</groupId>
  <artifactId>FX-BorderlessScene</artifactId>
  <version>4.4.0</version>
</dependency>

> Advanced example (styling AeroSnap Window , spying window maximize status etc ) with ready code for you to run

Main Window -> here

Main Window Controller -> here

Simple example

import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import com.goxr3plus.fxborderlessscene.borderless.BorderlessScene;

/**
 * Testing the application to see if it works
 * 
 * @author GOXR3PLUS
 *
 */
public class Main extends Application {
	
	@Override
	public void start(Stage primaryStage) throws Exception {
		
		//BorderPane
		BorderPane borderPane = new BorderPane();
		
		//Create a Top Label
		Label topLabel = new Label("Drag Me :)");
		topLabel.setMinHeight(50);
		topLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
		topLabel.setStyle("-fx-background-color:#303030; -fx-text-fill:white; -fx-font-weight:bold;");
		topLabel.setAlignment(Pos.CENTER);
		borderPane.setTop(topLabel);
		
		//Close Button
		Button closeButton = new Button("Exit");
		closeButton.setOnAction(a -> primaryStage.close());
		
		// Constructor using your primary stage and the root Parent of your content.
		BorderlessScene scene = new BorderlessScene(primaryStage, StageStyle.UNDECORATED, borderPane, 250, 250);
		primaryStage.setScene(scene); // Set the scene to your stage and you're done!
		
		//Close Button
		Button removeDefaultCSS = new Button("Remove Default Corners CSS");
		removeDefaultCSS.setOnAction(a -> scene.removeDefaultCSS());
		
		//BorderPane
		HBox hbox = new HBox(removeDefaultCSS,closeButton);
		hbox.setAlignment(Pos.CENTER);
		hbox.setSpacing(15);
		borderPane.setCenter(hbox);
		
		//remove the default css style
		//scene.removeDefaultCSS();
		
		// Maximise (on/off) and minimise the application:
		//scene.maximizeStage();
		//scene.minimizeStage();
		
		// To move the window around by pressing a node:
		scene.setMoveControl(topLabel);
		
		// To disable resize:
		//scene.setResizable(false);
		
		// To switch the content during runtime:
		//scene.setContent(yourNewParent);
		
		// Check if maximised:
		//Boolean bool = scene.isMaximised();
		
		// Get windowed* size and position:
		//scene.getWindowedSize();
		//scene.getWindowedPosition();
		
		//Show
		primaryStage.setTitle("Draggable and Undecorated JavaFX Window");
		primaryStage.show();
		
	}
	
	public static void main(String[] args) {
		launch(args);
	}
	
}

XR3Player is using this Library

Video
First

Issues
  • Version 4.0.0 is not working

    Version 4.0.0 is not working

    opened by Marcoral 7
  • horizontal right and vertical bottom resizing lag on macOS

    horizontal right and vertical bottom resizing lag on macOS

    Hi, I don't know if it's the case on Windows or Linux but on macOS when I resize the windows horizontally on right and vertically on bottom ( right top and right bottom diagonal too) the resizing is lagging.

    Thanks

    Demo

    opened by Typhon0 6
  • Scene doesn't resize after update 4.0.0

    Scene doesn't resize after update 4.0.0

    It seems that update 4.0.0 really broke up many things :/ Starting from this version, BorderlessController is created via constructor, not by FXMLLoader as it used to be up to that version. Now all the resizeControlls (leftPane, rightPane etc.) are NOT being injected by the loader and have null references. Furthermore, BorderlessController.initialize() method is never invoked. I strongly recommend you to revert project back to version 3.1.0.

    It would also fix below issue: https://github.com/goxr3plus/FX-BorderlessScene/issues/16

    opened by Marcoral 6
  • fix resize lag

    fix resize lag

    fix issue #2

    opened by Typhon0 4
  • Stange NullPointerException in Line 242  BorderlessController

    Stange NullPointerException in Line 242 BorderlessController

    @Typhon0 Hello my dear friend , i just notices a strange bug here :

    Line 242 BorderlessController

    if (m.getScreenY() > eventSource.y) {
         stage.setWidth(prevSize.x);
         stage.setHeight(prevSize.y);
        snapped = false;
    }
    

    I have no clue why that error happens sometimes but it doesn....

    bug help wanted 
    opened by goxr3plus 4
  • fixed minor issue

    fixed minor issue

    When you set maximized it doesn't need to change the resizable property

    opened by selimbousbih 4
  • Fixed a possible IndexOutOfBoundsException

    Fixed a possible IndexOutOfBoundsException

    This exception can be easily reproduced with a laptop and monitor

    1. Run your app while monitor is connected and laptop lid closed.
    2. Disconnect the monitor and open laptop lid
    3. Try to use aero snap feature by dragging your app to screen edges
    4. Exception occurs

    Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:657) at java.util.ArrayList.get(ArrayList.java:433) at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89) at com.goxr3plus.fxborderlessscene.borderless.BorderlessController.lambda$1(BorderlessController.java:292) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$MouseHandler.process(Scene.java:3757) at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$358(GlassViewEventHandler.java:432) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431) at com.sun.glass.ui.View.handleMouseEvent(View.java:555) at com.sun.glass.ui.View.notifyMouse(View.java:937) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$152(WinApplication.java:177) at java.lang.Thread.run(Thread.java:748)

    bug enhancement 
    opened by gilad4 3
  • Add a listener for resize control nodes

    Add a listener for resize control nodes

    Added listener for when dragging initially starts to record the initial prevSize/prevPoint. Changed m.getButton().equals to MouseButton.PRIMARY.equals (not needed but good habit).

    opened by bwcsemaj 3
  • Add Aero Snap disabling feature

    Add Aero Snap disabling feature

    • Added possibility to disable Aero Snap features for creating JavaFX-like StageStyle.UTILITY stages (they don't have such features as well);
    • Added property for "resizable";
    • Removed non-static way of assignment in Main class;
    opened by Marcoral 2
  • removeDefaultCSS() on BorderScene causes java.lang.IndexOutOfBoundsException

    removeDefaultCSS() on BorderScene causes java.lang.IndexOutOfBoundsException

    It's me again. After update to version 4.1.0, method removeDefaultCSS() from BorderScene, started to throw java.lang.IndexOutOfBoundsException.

    How to reproduce: Run com.goxr3plus.fxborderlessscene.application.Main, but add borderlessScene.removeDefaultCSS() in 28th line of file (just after object creation). It will throw an exception mentioned above.

    I've solved this problem on my own - you can just merge my branch with master.

    opened by Marcoral 2
  • Laggish TopLeft Resizing

    Laggish TopLeft Resizing

    If you try to resize the window from the topLeft corner it appears very laggy.

    A solution must be found for this.

    bug enhancement help wanted 
    opened by goxr3plus 0
  • Minimizing undecorated stage

    Minimizing undecorated stage

    Undecorated stages have one annoying property - they don't minimize as you click at its icon on OS task bar in opposite to decorated ones. I found a solution that actually seem to work, but I have it tested only on Win7. I am not familiar with JNA at all and I am not sure whether we should go that far with enhancing a project as it would require additional library to work. What do you think about it?

    enhancement question 
    opened by Marcoral 13
  • Aero Snap doesn't work correctly when windows bar is on the left or right side of the screen

    Aero Snap doesn't work correctly when windows bar is on the left or right side of the screen

    Sometimes the down and down right aero snap leave the window as shown below . Sometimes it works and sometimes not ... i don't know why :

    2019-04-30_17-40-29 2019-04-30_17-40-37

    bug enhancement help wanted 
    opened by goxr3plus 0
  • Added Aero Feature.

    Added Aero Feature.

    Added aero feature to Borderless Scene. Got rid of the previous solution. Added some variables. One of which could be a property.

    BUFFER_SPACE is used to make it so you don't have be exactly in the corner in order to snap in the corner. Right now I set it to 100 but it can be anything greater than or equal 0.

    I added a Direction Enum to help with the calculation. The direction values also could be boolean value though I found it more nicer with the Enum.

    opened by bwcsemaj 8
  • Support  Windows Aero Snap control for screen corners

    Support Windows Aero Snap control for screen corners

    Till now i have implemented Aero Snap for top bottom right and left side.

    But if you drag a window in windows on the corners of the screen you can see that it resizes to 1/4 of the screen to the corner you have dragged it ... for example .

    2018-10-01_15-54-37

    bug enhancement help wanted 
    opened by goxr3plus 12
Releases(4.4.0)
Owner
Alexander Kentros
“Pursue excellence, and success will follow" I cheated Java with Javascript because she is sexier !
Alexander Kentros
Simple and clean testing for JavaFX.

TestFX Simple and clean testing for JavaFX. TestFX requires a minimum Java version of 8 (1.8). Documentation See the Javadocs for latest master. See t

null 698 Mar 12, 2021
Reactive JavaFX Event Handling

ReactorFX This lightweight convenience library allows for simple integration between Project Reactor and JavaFX. ReactorFX provides fluent factories t

Jake 18 Nov 10, 2020
A scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.

ChartFx ChartFx is a scientific charting library developed at GSI for FAIR with focus on performance optimised real-time data visualisation at 25 Hz u

GSI CS-CO/ACO 250 Apr 24, 2021
A JavaFX UI framework to create fully customized undecorated windows

CustomStage A JavaFX undecorated stage which can fully be customized Donations If this project is helpful to you and love my work and feel like showin

Oshan Mendis 148 Feb 21, 2021
RxJava bindings for JavaFX

RxJavaFX: JavaFX bindings for RxJava Read the free eBook Learning RxJava with JavaFX to get started. RxJavaFX is a lightweight library to convert Java

ReactiveX 488 Mar 9, 2021
📊 Exposing charts from Java to JavaFX and the Web!

Exposing charts from Java to JavaFX and to the Web! JavaFX · Charts · Websockets · Jetty · Web JavaFxDataviewer is an open-source data visualization t

jasrodis 56 Oct 27, 2020
A lightweight RCP framework for JavaFX applications.

WorkbenchFX The one and only framework to build large JavaFX Applications! Maven To use this framework as part of your Maven build simply add the foll

DLSC Software & Consulting GmbH 399 May 6, 2021
Full Featured Google Chrome Dev Tools to JavaFX WebView browser debugging.

JavaFX WebView Debugger Via WebSocket connection to Google Chrome Dev Tools JavaFx WebView debugging with Chrome Dev tools is highly dependent on Goog

Vladimir Schneider 45 Jan 29, 2021
BootstrapFX: Bootstrap for JavaFX

BootstrapFX BootstrapFX is a partial port of Twitter Bootstrap for JavaFX. It mainly provides a CSS stylesheet that closely resembles the original whi

Kordamp 589 Mar 13, 2021
Provides a Java API to use the JavaScript library d3.js with the JavaFx WebView

javafx-d3 Provides a Java API for using the JavaScript library d3.js with JavaFx Applications. Many thanks to the authors of the projects gwt-d3 [1] a

null 90 Feb 13, 2021
图形化漏洞利用Demo-JavaFX版

更新 V1.1 参考冰蝎的代理,添加代理设置,方便走burp调试 优化批量检查逻辑,使用接口,这样每次添加新的漏洞利用时,就不需要修改批量检查的逻辑。 0x01 这是个嘛? 这是一个构建图形化漏洞利用的一个项目,已经写好架子,只需要往里填充exp即可,帮助安全人员快速构建一个图形化的、跨平台的漏洞利

yhy 56 Apr 7, 2021
Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE 8 and provides the functionalities to use and handle easily Tiles in your JavaFX application.

Lib-Tile Intention Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE and provides the functionalities to use and handle easily Tile

Peter Rogge 11 Jun 8, 2020
MDI components for JavaFX

DesktopPaneFX DesktopPaneFX is a JavaFX version of Swing’s JDesktopPane which can be used as a container for individual "child" similar to JInternalFr

Kordamp 50 Mar 3, 2021
A collection of JavaFX controls and utilities.

GemsFX At least JDK 11 is required. Dialog Pane The class DialogPane can be used as a layer on top of any application. It offers various methods to di

DLSC Software & Consulting GmbH 146 Mar 11, 2021