Skip to content

Cannot enable assertions in JavaFX #9194

@KenWi11iams

Description

@KenWi11iams

Apache NetBeans version

Apache NetBeans 28

What happened

When you use Scenebuilder, it creates a skeleton controller class for the scene. The initialize method created by Scenebuilder generates several assert statements validating the state of the GUI variables. This is very useful to ensure the FXML and java class are in synch. The assert statement is default disabled in Java. You must put the -enableassertions option on the Java command.

skeleton GetMasterPW.java

Unfortunately, when you go to the project properties/Run, the VM options are disabled with the warning, "One of Run/Debug/Profile Project actions has been modified and the Run panel cannot be safely edited."
It would be very useful if assert statements count be enabled somehow.

Language / Project Type / NetBeans Component

No response

How to reproduce

Create a JavaFX application with Maven. Create a FXML file using Scenebuilder. In Scenebuilder, go to View / Show sample controller skeleton.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 11 Home 25H2

JDK

openjdk version "24.0.1" 2025-04-15

Apache NetBeans packaging

Community provided installer

Anything else

The problem occurs every time.

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions