Skip to content

Instantly share code, notes, and snippets.

View k33ptoo's full-sized avatar
💻
Anything frontend & Kotlin

Amos Chepchieng k33ptoo

💻
Anything frontend & Kotlin
View GitHub Profile
@k33ptoo
k33ptoo / Movable JavaFX Window.java
Created July 31, 2017 07:57
Renders a borderless/underdecorated window movable/dragable
/*
* The MIT License
*
* Copyright 2017 keeptoo.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
protected override CreateParams CreateParams
{
get
{
const int CS_DROPSHADOW = 0x20000;
CreateParams cp = base.CreateParams;
cp.ClassStyle |= CS_DROPSHADOW;
cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
return cp;
}