💠 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

Comments
  • Version 4.0.0 is not working

    Version 4.0.0 is not working

    opened by Marcoral 7
  • 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
  • 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
  • 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 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
  • 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
  • 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
  • Cannot access to Delta class.

    Cannot access to Delta class.

    Hello goxr3plus! I try to get instances of Delta class through BorderlessScene#getWindowedSize() and BorderlessScene#getWindowedPositon() methods. These methods are available public access, but Delta class is not public.

    Thanks.

    opened by dddddommm 2
  • Added Aero Snap feature.

    Added Aero Snap feature.

    As the commit states I reworked the aero snap feature. To be honest I'm surprised how long it took me to actually do this. I thought it was going to be simple tweaks. I tried two different attempts that failed. Then I drew a grid of screens with coordinates and saw patterns and applied that to my solution.

    I will probably tomorrow go over the code. I added a BUFFER in the calculation so you don't have to perfectly line it on the edge of the screen. This helps when you have multiple monitors; it can be a bitch to align in a corner because your mouse will just go to the next screen.

    One bug I noticed say you resize the screen to the very top. The top will go as high and so will the bottom. Because of the buffer, you aren't able to then click on the move node and drag and keep it at top and bottom. I might have to make a gif to show.

    Also, exposing the BUFFER or even renaming it so it makes sense might be something people would want to change. I put it at 100 for now but again can easily be anything not negative.

    I also believe there probably is a better way to solve this will using Math.abs(...) I tried attempting one of my solutions with it but kept failing so I ended up somewhat hard coding the solution.

    opened by bwcsemaj 2
  • Adding a way to restore the screen, such as how minimize and maximize work.

    Adding a way to restore the screen, such as how minimize and maximize work.

    I don't know the best way to go about this but I think there should be a feature where you can call a method to restore the screen to it's original size after being minimized or maximized. From the code it already looks like it keeps track of the last position and size and uses this to restore in the minimize but I think that part of the code could be it's own seperate part.

    Even when maximizing and then you drag the move control, it auto restores to the original size. Again I think this code could be put into it's own method that can be called upon at will.

    Or you could expose the previous point and size but I don't think this is probably that great of an idea. I don't know if it is already exposed either.

    opened by bwcsemaj 2
  • 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
  • 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
Decorate "Undecorated" JavaFX windows

DEPRECATED: The latest version of this project is UndecoratorBis https://github.com/in-sideFX/UndecoratorBis Undecorator Decorate undecorated Java

null 115 Sep 23, 2022
A collection of Apple UI controls implemented in JavaFX.

Apple FX A collection of Apple UI controls implemented in JavaFX. Available Macos controls: MacosButton MacosCheckBox MacosRadioButton MacosLabel Maco

Gerrit Grunwald 17 Sep 25, 2022
Flash cards app using JavaFX, Scene Builder and persistence using Serialization with JAVA IO API

Flashcards - JavaFX , Scene Builder, Serialized Persistence JAVA IO API Main Scene that will show all the Decks in Flash Card App Add or Edit Cards in

Ali Raja 3 Nov 28, 2022
SimpleFXLoader - Simple JavaFX Scene/Object hierarchy loader.

SimpleFXLoader Simple JavaFX Scene/Object hierarchy loader that can load dynamically some Controller Class once some annotations are used. This only w

Ryan Thomas Payne 2 Dec 30, 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 269 Jan 5, 2023
Composable event handlers and skin scaffolding for JavaFX controls.

This project is no longer being maintained. See this issue for more details. WellBehavedFX This project provides a better mechanism for defining and o

null 52 Oct 9, 2022
Controls for adding Parallax effects for Java (JavaFX)

FXParallax Parallax framework for Java (JavaFX). This framework adds controls to add Parallax effects to JavaFX application, this effect can add a sen

Pedro Duque Vieira 36 Sep 30, 2022
A project that shows the different ways on how to create custom controls in JavaFX

JavaFX Custom Controls This project will show different ways on how to create custom controls in JavaFX. It will cover the following approaches: Resty

Gerrit Grunwald 27 Sep 5, 2022
Android Resource Manager application to manage and analysis your app resources with many features like image resize, Color, Dimens and code Analysis

AndroidResourceManager Cross-Platform tools to manage your resources as an Android Developer, AndroidResourceManager - ARM provide five main services

Amr Hesham 26 Nov 16, 2022
A prayer times (Adhan) app for Windows and GNU/Linux written in JavaFX.

Salawat Salawat - سالوات A prayer times and Adhan application for Windows, macOS and GNU/Linux written in Java Download » View Demo · Report Bug · Req

DarkBlackChocolate 8 Nov 17, 2022
A library for JavaFX that gives you the ability to show progress on the Windows taskbar.

A clean and easy way to implement this amazing native Windows taskbar-progressbar functionality in javaFX Background Since Windows 7 there is a taskba

Daniel Gyoerffy 77 Nov 28, 2022
Glucose status monitor for Nightscout implemented in JavaFX

GlucoStatusFX A glucose status monitor for Nightscout implemented in JavaFX. Donations are welcome at Paypal Intro GlucoStatusFX is a JavaFX applicati

Gerrit Grunwald 17 Dec 15, 2022
Custom captions (window decorations) on Windows for JavaFX

javafx-customcaption javafx-customcaption is designed to allow customizing the native window caption on Microsoft Windows Usage: You can use the follo

null 3 Dec 15, 2022
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 13 Apr 13, 2022
Terminal GUI library for simple ANSI console tools and graphical interfaces with Windows/Linux support

TerminalCore Terminal GUI library for Windows/Linux. This library contains all colors as ascii codes, native functions of the respective operating sys

Pascal 3 Oct 19, 2022
A high-performance Java API wrapper for arblib, the fantastic and amazing arbitrary-precision ball arithmetic C library, implemented via SWIG

A high-performance Java API wrapper for arblib, the fantastic and amazing arbitrary-precision ball arithmetic C library, implemented via SWIG

null 3 Dec 19, 2022
WavesFX an open-source Waves wallet for Windows, macOS and Linux

WavesFX WavesFX is an open-source Waves wallet for Windows, macOS and Linux. Telegram Chat Releases can be found on the release list. How to build Wav

WavesFX 22 Apr 15, 2022
DataFX - is a JavaFX frameworks that provides additional features to create MVC based applications in JavaFX by providing routing and a context for CDI.

What you’ve stumbled upon here is a project that intends to make retrieving, massaging, populating, viewing, and editing data in JavaFX UI controls ea

Guigarage 110 Dec 29, 2022
InstallRepos - Install GitHub Repository on any Operating System (Linux, MacOS or Windows).

Install Repos Install GitHub Repository on any Operating System (Linux, MacOS or Windows). Requires Java JRE 17.0.0.1 or later. Repository Includes: s

Tushar Chaurasia 2 Apr 21, 2022