Custom Component Class Not Found

Hi,

I am totally stuck - I have several custom components in one of my forms. They worked OK at some point, after I added the custom components to the palette. They also compile OK - the generated output is correct and it all works.

But I am getting a lot of errors in the UI designer. For example, I can't move those custom components around - if I do, they "disappear". In fact, grabbing a component that contains one of the custom ones doesn't work, they don't insert anywhere.

I tried removing the components and adding them back in, using the "search" feature to search for the class names. I figured if the search can see the class name, the UI designer will be able to too. But it didn't work, they still show as "class bla not found" and appear as red boxes.

Are there any caches I could reset, or any other way to restore this to the way it was? Going back in the SCM would be an option of course but I am pretty short on time and it seems like this could be a huge time sink.

thanks for any pointers!

10 comments
Comment actions Permalink

Hi.

> But it didn't work, they still show as "class bla not found" and appear as red boxes.

IDEA needs compiled component class to show it. Make sure it is compiled and then press Reload Custom Components button on Designer's toolbar.

Alexander.

0
Comment actions Permalink

Yep, Reload Custom Components, that did it.

Thanks a lot!

0
Comment actions Permalink

Hi, i encounter the same problem.

I have a class in my project extends JButton, and try to add it to palette. But UIDesigner always shows "Class com.ui.myJButton not found".

Per your response, i recompiled and click ReloadCustomComponent, the problem was still present.

0
Comment actions Permalink

Hi.

It works for me.

Trying to guess... Do you run IDEA (IDEA itself, not your project - see About dialog) with JDK 1.6 or with older version?

Alexander.

0
Comment actions Permalink

Intellij IDEA 9.0.1
JDK 1.6.0_17

I guess it may be a bug. I could not have any idea and my program stuck.

0
Comment actions Permalink

-Idea11-

Ran into the same problem.  As I develop a db JList component from another module in the same project, I get that error in the designer.  Originally I was building it by extending my class with JScrollPane and would see the error mentioned above.  Then I decided to create the component in the same way as Java by only extending the JList component and adding the JScrollPane in the designer in the same way we do it for a JList.  That seems to have caused the error to go away.

So I insert the custom component (CustomList extends JList)  then put it into a JScrollPane in the designer.  Error is gone.  ?  (I'm sure for a Java expert it's obvious what I'm doing wrong... )

0
Comment actions Permalink

2020 and I'm getting the same error =/
I'm trying to put a custom component and I'm getting class not found. I'm using Intellij IDEA 2019.3.1, java 13.0.2

I have tried to compile the class, invalidate and restart. But without success. I can't find the Reload Custom Components button.

Some times I get class not found, some times I can't add the custom component, or I get unsupported class version error =(

What could I do?

 

0
Comment actions Permalink

Hello,

Please report an issue on YouTrack (https://youtrack.jetbrains.com/issues/IDEA) attaching idea.log ("Help | Show Log in...") after restarting IDE and reproducing the issue.

0
Comment actions Permalink

I checked the log and found this:

2020-03-12 14:56:32,883 [ 19974] ERROR - llij.ide.plugins.PluginManager - MyPanel has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0

So, I installed the openjdk-11, changed the default java, changed the project SDK to 11. And it worked like a charm.

Thanks a lot =)

0
Comment actions Permalink

You are welcome!

0

Please sign in to leave a comment.