Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component Border From Form Designed code had null #8337

Open
olenbn opened this issue Mar 15, 2025 · 3 comments
Open

Component Border From Form Designed code had null #8337

olenbn opened this issue Mar 15, 2025 · 3 comments
Labels
FormDesigner GUI builder, also known as Matisse kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@olenbn
Copy link

olenbn commented Mar 15, 2025

Apache NetBeans version

Apache NetBeans 25

What happened

I encountered an issue with Netbeans 25.
I installed AlamLinux 9 in a VM.
Then I installed openjdk 21 (latest as of 3/13/2025)
Then I install Netbeans 25 from the 'noarch' rpm.
I started Netbeans and made a new gradle project.
Then I made a JFrame form.
Then I added a panel. Tried to set the panel boarder but there were no options in the dropdown menu of the GUI designer.
The code it had generated would not compile.

So then I closed netbeans.
I downgraded to openjdk 17.
Restarted netbeans, and now the GUI designer would work, A raised bevel border could be created, and the code
would compile.

So now I've gone back to openjdk 21, and it also still seems to work. So this is good.
But I'm not sure why the original run would have failed, or if the issue is with first creating a java project,
or having first run with openjdk 21 versus 17.

Language / Project Type / NetBeans Component

Java JFrame Form Border

How to reproduce

Hopefully the above steps reproduce the issue for you.

Did this work correctly in an earlier version?

No / Don't know

Operating System

AlmaLinux 9

JDK

openjdk 21

Apache NetBeans packaging

Other, Apache NetBeans provided installer

Anything else

Seemed to just be on the first run.

Are you willing to submit a pull request?

No

@olenbn olenbn added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Mar 15, 2025
@mbien mbien added the FormDesigner GUI builder, also known as Matisse label Mar 15, 2025
@matthiasblaesing
Copy link
Contributor

This is not reproducible. I followed the steps (using the netinstall iso for Alma 9) and with that I get:

Image

The generated code looks sane to me:

Image

The code builds fine. So thanks for the report, but it is not actionable.

@olenbn
Copy link
Author

olenbn commented Mar 17, 2025

I can see that you have reproduced the problem.
If you look in the window properties for etched border, that you have selected there should be options for in or out or something similar not broken.

In line 33, the border factory call is making a line border with a null color, and this should not compile, as null cannot be converted into a color.

@matthiasblaesing
Copy link
Contributor

matthiasblaesing commented Mar 17, 2025

I can see that you have reproduced the problem. If you look in the window properties for etched border, that you have selected there should be options for in or out or something similar not broken.

That is very subtle and it would have been helpful to have this information in the original report. Anyway, I suspect, that we see a race-condition between the JDK initialized by the gradle infrastructure and the NB scanner.

In line 33, the border factory call is making a line border with a null color, and this should not compile, as null cannot be converted into a color.

The code will compile, it might blow at runtime though. Java is not kotlin, at this point in time null can be used at all places where an object is expected.

Edit: reopened, I won't look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FormDesigner GUI builder, also known as Matisse kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

3 participants