facebook

Adding custom JPanel from within project

  1. MyEclipse Archived
  2.  > 
  3. Matisse/Swing UI Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #271029 Reply

    Paul Wade
    Member

    Hi,

    Probably another stupid question, but Google is failing me and this is something that’s fairly easy to do in NetBeans.

    I have a project in which I have two forms. A JFrame and a JPanel. I would like to add the JPanel I created in my project to the JFrame in my project. The intuitive way to do this seemed to be to add my JPanel to the Matisse pallette and then add it to my JFrame from there. However, regardless of how I add it, where I put the class file, or where the source is (i.e. in the same package or a sub-package), I get this error:

    “Cannot load component class com.mypackage.myJPanel from project: C:\myProject.
    The class must be compiled and must be on the classpath of the project this form belongs to.”

    Since the class file is in fact compiled and since the class file is located in the same package, this error isn’t very useful. I’m sure I’m doing something wrong, but I haven’t been able to find any specific direction on how to do this in either Help, the forums, or Google.

    Thanks,
    Paul

    #271097 Reply

    Riyad Kalla
    Member

    Paul,
    I couldn’t reproduce this (I attached my sample project). The trick, I think, is it use Add Form when adding the Panel to the palette.

    Attachments:
    You must be logged in to view attached files.
    #272978 Reply

    jhoffman
    Member

    I had a similar problem with adding components. I am using JDK 6.0.2, and I think that was the problem. I resolved it by putting the component into a separate project that is set to use JDK 5.

    Jeff

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Adding custom JPanel from within project

You must be logged in to post in the forum log in