Board index » jbuilder » JB2005: Unable to design xxx.java

JB2005: Unable to design xxx.java


2005-01-06 11:10:50 AM
jbuilder10
Hi,
When I switch to design tab, the following errors occur:
class java.lang.NullPointerException null
Unable to design SwingTerminal.java. Make sure that the file is in the
current project, does not contain any syntax errors, and that all resources
are compiled.
What's the posible reason? Thanks.
 
 

Re:JB2005: Unable to design xxx.java

I found out that if I add an assertion into any method of the class, the
error will occur. Isn't that a bug?
"Aven" < XXXX@XXXXX.COM >wrote in message
Quote
Hi,
When I switch to design tab, the following errors occur:

class java.lang.NullPointerException null
Unable to design SwingTerminal.java. Make sure that the file is in the
current project, does not contain any syntax errors, and that all
resources
are compiled.

What's the posible reason? Thanks.


 

Re:JB2005: Unable to design xxx.java

Aven wrote:
Quote
I found out that if I add an assertion into any method of the class, the
error will occur. Isn't that a bug?

If you could provide an example, it would help.
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html
 

{smallsort}

Re:JB2005: Unable to design xxx.java

Well,
Create a new application with a new frame, say Frame1. In Frame1, add a
method:
void test() {
assert(this!=null);
}
Switch to design tab, then the error occurs.
"Lori M Olson [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
Aven wrote:
>I found out that if I add an assertion into any method of the class, the
>error will occur. Isn't that a bug?
>

If you could provide an example, it would help.

--

Regards,

Lori Olson [TeamB]

------------

Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.

Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html

 

Re:JB2005: Unable to design xxx.java

On 1/6/2005 at 4:22:14 AM, Aven wrote:
Quote
Create a new application with a new frame, say Frame1. In Frame1, add a
method:
void test() {
assert(this!=null);
}
It is generally a better idea to give a (small) actual example of the
problem, rather than give instructions on how to produce one. Sometimes,
you may not realize what the cause is, so you could leave out the
essential element required to reproduce the bug.
It also would be a good idea to mention which JBuilder version and SKU you
are using.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
 

Re:JB2005: Unable to design xxx.java

I use JBuilder 2005 Foundation running on Win XP.
I simply create a new project and a new application.
The project uses JDK 1.5.0.
The code is as follows.
package untitled1;
import java.awt.*;
import javax.swing.*;
public class Frame1
extends JFrame {
void test() {
assert(this!=null);
}
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
public Frame1() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
}
catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* Component initialization.
*
* @throws java.lang.Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(borderLayout1);
setSize(new Dimension(400, 300));
setTitle("Frame Title");
}
}
Before I add method test(), everything is OK. After I add it and switch to
design tab, the mentioned
error occurs. Apparently it is because of the assertion.
"John McGrath [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
On 1/6/2005 at 4:22:14 AM, Aven wrote:

>Create a new application with a new frame, say Frame1. In Frame1, add a
>method:
>void test() {
>assert(this!=null);
>}

It is generally a better idea to give a (small) actual example of the
problem, rather than give instructions on how to produce one. Sometimes,
you may not realize what the cause is, so you could leave out the
essential element required to reproduce the bug.

It also would be a good idea to mention which JBuilder version and SKU you
are using.

--
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
 

Re:JB2005: Unable to design xxx.java

On 1/6/2005 at 2:39:49 PM, Aven wrote:
Quote
I use JBuilder 2005 Foundation running on Win XP.
I simply create a new project and a new application.
The project uses JDK 1.5.0.
The code is as follows.
:
Quote
Before I add method test(), everything is OK. After I add it and switch
to design tab, the mentioned
error occurs. Apparently it is because of the assertion.
I do not see the NullPointerException, but I do get an error when I view
the class in the UI designer. What I see in the message pane is:
Failed to create live visual subcomponent this as .
Creating a red component in its place
Warning: cannot set "title" property for this --
java.lang.IllegalArgumentException: object is not an instance of
declaring class
Failed to create live visual subcomponent contentPane (BorderLayout) as
JPanel contentPane;. Creating using default constructor
javax.swing.JPanel
I also see a SecurityException in JBuilder's stderr output. I tried
wrapping the assert in a Beans.isDesignTime() test, but that had no
effect. Unfortunately, I cannot think of any way around the problem, save
commenting out the assert.
I am not sure why we see different errors, but there does seem to be a
problem here. It would be a good idea to submit a report for this problem
on QualityCentral.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
 

Re:JB2005: Unable to design xxx.java

Aven wrote:
Quote
I use JBuilder 2005 Foundation running on Win XP.
I simply create a new project and a new application.
The project uses JDK 1.5.0.
The code is as follows.

Just an added note here. Jbuilder has often had problems if you are
designing applications using a different version of the JDK than
JBuilder runs on. Can you try to design this using JDK 1.4.2 and see if
you still get the same problem?
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html
 

Re:JB2005: Unable to design xxx.java

Update 4 now available for download and it should fix "assert" problem
Best regards,
Vladislav
"John McGrath [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
On 1/6/2005 at 2:39:49 PM, Aven wrote:

>I use JBuilder 2005 Foundation running on Win XP.
>I simply create a new project and a new application.
>The project uses JDK 1.5.0.
>The code is as follows.
:

>Before I add method test(), everything is OK. After I add it and switch
>to design tab, the mentioned
>error occurs. Apparently it is because of the assertion.

I do not see the NullPointerException, but I do get an error when I view
the class in the UI designer. What I see in the message pane is:

Failed to create live visual subcomponent this as .
Creating a red component in its place
Warning: cannot set "title" property for this --
java.lang.IllegalArgumentException: object is not an instance of
declaring class
Failed to create live visual subcomponent contentPane (BorderLayout) as
JPanel contentPane;. Creating using default constructor
javax.swing.JPanel

I also see a SecurityException in JBuilder's stderr output. I tried
wrapping the assert in a Beans.isDesignTime() test, but that had no
effect. Unfortunately, I cannot think of any way around the problem, save
commenting out the assert.

I am not sure why we see different errors, but there does seem to be a
problem here. It would be a good idea to submit a report for this problem
on QualityCentral.

--
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html