/floaty-field

Floaty Field is a JavaFX port of the JVFloatLabeledTextField project.

Primary LanguageJavaMIT LicenseMIT

Floaty Field

Floaty Field is a JavaFX port of the JVFloatLabeledTextField project.

you cannot see the beautiful screen shot

Credits for the concept to Matt D. Smith, and his original design:

Matt D. Smith's Design

Say Hi @erlyberlytips or check it out on youtube

Compiling

To add floaty-field as a Maven dependency, add the jitpack repository to your project's pom.xml.

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

Now you can add floaty-field to your pom.xml dependencies:

<dependency>
  <groupId>andytill</groupId>
  <artifactId>floaty-field</artifactId>
  <version>1.1.0</version>
</dependency>

Usage

Firstly, make sure that the floaty field css is added to the scene that the control will be used in.

scene.getStylesheets().add(getClass().getResource("/floatyfield/floaty-field.css").toExternalForm());

Without this, the style and layout will look very bad! To instantiate a FloatyFieldControl call the constructor.

FloatyFieldControl myControl = new FloatyFieldControl();

The prompt text is shown in large when there is no text, when the text is not empty the prompt text is shown in small above.

myControl.getModel().promptTextProperty().set("Node Name");
myControl.getModel().textProperty().set("Some Input");