NetBeans GUI builder: "loading..." message - java

Sample project from the NetBeans tutorials set contains only one Swing form (empty JFrame), compiles and runs fine, but I can't change layout of the form and add elements in it with the NetBeans GUI buider since it shows only empty placeholder with single "loading..." message. Any clues how to fix it would be highly appreciated.
Kubuntu 12.04, Openjdk 1.7, NetBeans 7.0.1 with active GUI designer plugin.
Log file contains an error
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.form.FormDesigner$PreLoadTask

KNOWN BUG in Designer marked as done (Netbeans 7.0.1 GUI editor is not loading).
Get a new version from netbeans.
Seems to be the same problem.
reported:
...
All my projects are using SWING-components, and when I'm clicking
on "Design" switcher, in order to make changes in GUI, it is showing label
"loading" and I get following error:
...

I have very similar problem with NetBeans-7.2 on Gentoo system (the only difference is another error in the log: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal). The solution is to install dev-java/batik package and start NetBeans with
netbeans-7.2 -cp:a /usr/share/batik-1.7/lib/batik-ext.jar
These extra arguments can be added to netbeans_default_options in the /etc/netbeans-7.2/netbeans.conf to make a permanent fix. More information can be found here and here.

Related

netbeans icon ok in designer but fails when run (maven)

So I followed the netbeans (I'm using 12.2) tutorial for handling images:
https://netbeans.org/kb/73/java/gui-image-display.html?print=yes
I can see the icon in the designer but when run getResource() returns a null indicating it can't find the resource.
I have found this question which seemed to be related:
Netbeans ImageIcon not displaying
I have ensured that I am using a package and not a folder.
The error generated :
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.desktop/javax.swing.ImageIcon.<init>(ImageIcon.java:217)
at com.byotrader.zom.ZomFrame.initComponents(ZomFrame.java:37)
The line of code:
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/byotrader/zom/resources/ZomIcon.gif"))); // NOI18N
I have no idea why this is failing when run.
So my introduction to netbeans isn't going as smoothly as I hoped!
As requested project screen shot:
https://photos.app.goo.gl/CJ4EB3PD4a86nAVK8
Any ideas what I have failed to do?
One suggested answer relating to the following question :
netbeans & java, resourceMap.getString returning null
However the answer clearly states this is only a problem if a Clean build has not been done. That is not my issue as I have tried a clean build!
However looking in the .jar file I can see the picture resources have not been added! I assume this is the problem. However I have no idea how I can force the IDE to do its job!
Link to files structure:
https://photos.app.goo.gl/bRxHHW2UtRjPF7LeA
This link may also help others in future:
Netbeans Maven Project - Other Sources does not appear
(It is a Maven-Project!*) Put your image under:
src/main/resources/com/byotrader/zom/resources/ZomIcon.gif
../resources/...
Explanation:
Netbeans (when on a maven project) completely (except maybe in designer mode!;) builds with maven! ...which means... no gif (etc.) files are considered form src/main/java ... (check your target/classes folder!)
After my fix proposal, the image should be in the desired location.
* The tutorial(, which explicitly tells "Java Project") is little outdated for Netbeans 12.2, where there is no "Java Project"... possible alternatives are (maven/gradle) "Java Frontend Project" (requires javaFX!) or the "good ole" (ant) "Samples>Java With Ant".

Eclipse seems to think the CSS files are Java source code

I'm using Eclipse Eclipse IDE for Java Developers [Version: 2018-12 (4.10.0)
Build id: 20181214-0600] to develop a JavaFX project but I got some problems.
After a Java update, I've found several errors in my CSS files. Eclipse seems to think the CSS files are Java source code, as figured in the image below.
When I drag the mouse on a error, the description is "Syntax error on token 'Invalid character', interface expected" (because of # symbol)
I'm sure the code is correct because there are no errors before the latest java update to version 1.8.2.
Anyone can help me?
Most likely what happened here is what #Gianpio Benincasa said: You've created a new class, then in the file explorer you renamed it.
However, it's worth checking this one: Go to window/preferences, type 'associations' in the filter box to quickly nav to setting General>Editors>File Associations, and scroll through the file types list for *.css. Click on it, and check which editors are associated with it.
An eclipse with no particularly relevant plugins should only list 'Text Editor', and it should be marked as default. If you added plugins specifically for editing CSS, those will also be listed (and one of those is now probably default instead). Perhaps you or someone else went out of their way to add the java editor to this list somehow. If that is the case, simply make 'text editor' the default again (click it, click 'default'), then click on the java editor, and click 'remove'.
for eclipse that is a java class, in fact the icon has the "J". Probably when you created it you have created a new class and then have renamed it.
Create a new generic file instead a java class and copy the contents to the new file.
For create a generic file, rightclick and follow new-> other-> General-> files
Have a nice day

JavaFX font icons in FXML not working

I have gotten this result from running a javafx application using fontawesomefx
Caused by: java.lang.IllegalAccessError: tried to access method com.sun.javafx.css.parser.CSSParser.<init>()V from class de.jensd.fx.glyphs.GlyphIcon
at de.jensd.fx.glyphs.GlyphIcon.<clinit>(GlyphIcon.java:49)
I do not know how to fix a problem like this please help.
I would like to integrate resizable icons as font elements in java programs and this is one way I tried to do it but it does not work.
A couple of FontAwesomeFX library existing bug reports exist for this:
IllegalAccessError on FontAwesomeIcon construction. The bug report has been closed, but a comment by a user on the bug report states
the issue is still there in 8.9, try FontAwesomeFX 8.4
IllegalAccessError on FontAwesomeIcon construction. Same error, different report and further comments . . .
yes I was using JDK 1.8.0_31 that's why it doesn't work for me after updating to 1.8.0_92 version everything is working great.
AND
This is still an issue. com.sun.javafx.css.parser.CSSParser is not accessible in Java 9 resulting in java.lang.NoClassDefFoundError.
So, whether you get an error or not will depend on the Java version you are using (and, from your comments, the library is incompatible with all Java versions you have tried).
You will need to work with the developer of the library to get the error resolved.

Right Click Not Working in NetBeans 8.0.2

I installed NetBeans 8.0.2 recently, and tried to set null layout for a JFrame.
Tried to proceed but RIGHT CLICK on the frame didn't work. I am actually trying to set a background image for a frame.
Someone has already posted cannot right click on Jframe or Jpanel in netbeans 8.0 but it has no answers.
How to fix this problem? Hope that someone has found a solution.
It works for me to right-click on a JFrame and use Set Layout -> Null Layout with Netbeans 8.02. They did not remove it as an option. My guess would be that it is a problem specific to your configuration and/or installation.
Close Netbeans, delete your user configuration directory and cache directory ( see http://wiki.netbeans.org/FaqWhatIsUserdir ) and reopen Netbeans. If the problem persists use View -> IDE Log and add the Error messages from the log to your question. After opening Netbeans, only try one thing and then copy the log so you don't have a bunch of irrelevant error messages in the log.

Use the package matlabcontrol in my Java application to control Matlab?

I need to connect to Matlab from Java using matlabcontrol.
I tried their demos and those are working fine but when I tried to connect to Matlab using my application in Java RCP e4 I get this error (to be clear, my code succeeds in opening an instance of Matlab but afterwards the following appears in the Matlab window):
??? Undefined variable "matlabcontrol" or class "matlabcontrol.MatlabClassLoaderHelper.configureClassLoading".
And this appears in the eclipse server window:
matlabcontrol.MatlabConnectionException: MATLAB proxy could not be created in 180000 milliseconds
I tried searching for the answer and this came up: http://code.google.com/p/matlabcontrol/wiki/Compatibility
They say here that if this error comes, to run this command in Matab: java.lang.System.getProperty('java.class.version')
And if the answer is 50 or greater then matlabcontrol should work, but it doesn't for me.
I can't understand what's wrong (demo works, my code doesn't) and I'm desperately in need of an answer. This is for a project due soon and I would appreciate all the help I can get.
I faced a similar problem. This is what I did to solve the problem.
Go to the properties of your project in Eclipse. You can do this by selecting your project in "Package Explorer" and pressing Alt+Enter or by simply selecting properties on right click context menu.
In properties window, select "Java Compiler" and uncheck "Use compliance from execution.... 'JavaSE-1.8' on....". After that select "1.7" from drop down menu in "Compiler compliance level"
I hope this solves the problem for you!

Categories