Book Image

NetBeans IDE 8 Cookbook

By : David Salter, Rhawi Dantas
Book Image

NetBeans IDE 8 Cookbook

By: David Salter, Rhawi Dantas

Overview of this book

<p>From the start to the end of a Java project's lifecycle, this book will show you how to perform many key tasks with the NetBeans IDE, uncovering more about mobile, desktop, and enterprise Java along the way.</p> <p>You will start by creating Java projects and learning how to refactor and use NetBeans tools to increase developer efficiency. You will then get a walkthrough of how to create a desktop application before covering JavaFX and mobile applications and how to use external services within them. Having seen how to create many different types of applications, you will then be shown how to test and profile them before storing them in revision control systems such as Git or Subversion. Finally, you will learn how to extend NetBeans itself by adding new features to the IDE.</p>
Table of Contents (19 chapters)
NetBeans IDE 8 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Styling a JavaFX application with CSS


One of the benefits of JavaFX applications is that their user interfaces can be designed rather than developed. This is typically a job done by a designer rather than a developer. As such, it's a good practice to place all of the application styling outside of Java code within a CSS file.

It's possible to style a JavaFX application within Java code by setting fonts and colors and layout padding (we saw an example of setting padding on elements within the Creating a JavaFX application recipe) within the Java code, but obviously, this makes it more difficult to make style changes to an application.

In this recipe, we'll see how we can apply CSS changes primarily to FXML files. We'll also show how CSS can be applied to Java files for those that are curious about how to do this.

Getting ready

To complete this recipe, you'll need to have either the Java SE, or the Java EE version of NetBeans 8 installed together with a minimum of JDK 7u6 installed.

You will also...