Skip to main content



      Home
Home » Archived » Visual Editor (VE) » VE 1.0: Possible Code Generation Mistake
VE 1.0: Possible Code Generation Mistake [message #20191] Fri, 20 February 2004 02:41 Go to next message
Eclipse UserFriend
Hello,

I'm testing VE 1.0 (I20040219) from W2K and I observe the
code generated for the "getJContentPane" method (I test it
in a JFrame) and it seems there is a possible little mistake.
I have 2 JPanels in the ContentPane: panButtons and panFields.
So the code generated is:
jContentPane = new javax.swing.JPanel();
ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===

I have no problems from the design view, but when I execute
the main method of this class the frame appears empty. I must
change the lines order in the "getJContentPane" method:
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);

My JDK version is 1.4.2_03.

Other observations:
- No VE perspective.
- The speed is spectaculary improved.

Francesc Rosés
Re: VE 1.0: Possible Code Generation Mistake [message #20204 is a reply to message #20191] Fri, 20 February 2004 10:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

One thing, was it a typo below, but you one line that says
ContentPane.add and not jContentPane.add


Francesc Rosés wrote:

> Hello,
>
> I'm testing VE 1.0 (I20040219) from W2K and I observe the
> code generated for the "getJContentPane" method (I test it
> in a JFrame) and it seems there is a possible little mistake.
> I have 2 JPanels in the ContentPane: panButtons and panFields.
> So the code generated is:
> jContentPane = new javax.swing.JPanel();
ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
<----------------- This line here, is this a typo?

> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
>
> I have no problems from the design view, but when I execute
> the main method of this class the frame appears empty. I must
> change the lines order in the "getJContentPane" method:
> jContentPane = new javax.swing.JPanel();
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
> ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
>
> My JDK version is 1.4.2_03.
>
> Other observations:
> - No VE perspective.
> - The speed is spectaculary improved.
>
> Francesc Rosés
>

That shouldn't of occured. Can you reliably reproduce this? I tried on
my own and couldn't. And if you can, please give the steps to do this
and open a critical priority bugzilla against VE and component "java core".

--
Thanks, Rich Kulp

Re: VE 1.0: Possible Code Generation Mistake [message #20215 is a reply to message #20191] Fri, 20 February 2004 11:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi Francesc,

> I have 2 JPanels in the ContentPane: panButtons and panFields.
> So the code generated is:
> jContentPane = new javax.swing.JPanel();
> ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===

Where did the duplicate line come from that adds getPanFields() a second
time as the Center constraint ? Did the VE generate that ?

Best regards,

Joe Winchester
Re: VE 1.0: Possible Code Generation Mistake [message #20227 is a reply to message #20215] Sat, 21 February 2004 06:34 Go to previous messageGo to next message
Eclipse UserFriend
Hi Joe,

First of all, sorry for my delayed answer. Yesterday
my disk crashes.

I think the line code is my fault.

I respond Rich Tulp with the steps to reproduce
the error.

Best regards,

Francesc

Joe Winchester wrote:

> Hi Francesc,

> > I have 2 JPanels in the ContentPane: panButtons and panFields.
> > So the code generated is:
> > jContentPane = new javax.swing.JPanel();
> > ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===

> Where did the duplicate line come from that adds getPanFields() a second
> time as the Center constraint ? Did the VE generate that ?

> Best regards,

> Joe Winchester
Re: VE 1.0: Possible Code Generation Mistake [message #20232 is a reply to message #20204] Sat, 21 February 2004 06:43 Go to previous messageGo to next message
Eclipse UserFriend
Hi Rich,

First of all, sorry for my delayed answer. Yesterday
my disk crashes. No comment...

I copy the steps to reproduce the error and the evolution
of "getJContentPane" code generation.

Best regards,

Francesc

================================== cut here =============================
1. JFrame (with main)
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}

2. Adding a new JPanel (panButtons) using the Choose Bean
Dialog. The panel is added at south:
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}
3. Adding a new JPanel (panFields) using the Choose Bean
Dialog. The panel is added at center:
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}

4. Adding a JButton (pbExit) using the Choose Bean
Dialog to the panButtons:
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}

5. Adding a JLabel (stName) using the Choose Bean Dialog
to the panFields:
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}
================================== cut here =============================


Rich Kulp wrote:

> One thing, was it a typo below, but you one line that says
> ContentPane.add and not jContentPane.add


> Francesc Rosés wrote:

> > Hello,
> >
> > I'm testing VE 1.0 (I20040219) from W2K and I observe the
> > code generated for the "getJContentPane" method (I test it
> > in a JFrame) and it seems there is a possible little mistake.
> > I have 2 JPanels in the ContentPane: panButtons and panFields.
> > So the code generated is:
> > jContentPane = new javax.swing.JPanel();
> ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> <----------------- This line here, is this a typo?

> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
> >
> > I have no problems from the design view, but when I execute
> > the main method of this class the frame appears empty. I must
> > change the lines order in the "getJContentPane" method:
> > jContentPane = new javax.swing.JPanel();
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
> > ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> >
> > My JDK version is 1.4.2_03.
> >
> > Other observations:
> > - No VE perspective.
> > - The speed is spectaculary improved.
> >
> > Francesc Rosés
> >

> That shouldn't of occured. Can you reliably reproduce this? I tried on
> my own and couldn't. And if you can, please give the steps to do this
> and open a critical priority bugzilla against VE and component "java core".
Re: VE 1.0: Possible Code Generation Mistake [message #20239 is a reply to message #20232] Sat, 21 February 2004 19:43 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Ahh! We were focusing on what looked like a duplicate add(...) command,
but the real problem was calls created out of order.

As a matter of fact, we found your error while trying to reproduce your
results. We couldn't reproduce what the first note indicated (an extra
add component command) but we did see the out of order problem, and
we've fixed it.

It is https://bugs.eclipse.org/bugs/show_bug.cgi?id=52664

Thanks for bringing this to our attention.

--
Thanks, Rich Kulp

Re: VE 1.0: Possible Code Generation Mistake [message #581982 is a reply to message #20191] Fri, 20 February 2004 10:28 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

One thing, was it a typo below, but you one line that says
ContentPane.add and not jContentPane.add


Francesc Rosés wrote:

> Hello,
>
> I'm testing VE 1.0 (I20040219) from W2K and I observe the
> code generated for the "getJContentPane" method (I test it
> in a JFrame) and it seems there is a possible little mistake.
> I have 2 JPanels in the ContentPane: panButtons and panFields.
> So the code generated is:
> jContentPane = new javax.swing.JPanel();
ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
<----------------- This line here, is this a typo?

> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
>
> I have no problems from the design view, but when I execute
> the main method of this class the frame appears empty. I must
> change the lines order in the "getJContentPane" method:
> jContentPane = new javax.swing.JPanel();
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
> ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
>
> My JDK version is 1.4.2_03.
>
> Other observations:
> - No VE perspective.
> - The speed is spectaculary improved.
>
> Francesc Rosés
>

That shouldn't of occured. Can you reliably reproduce this? I tried on
my own and couldn't. And if you can, please give the steps to do this
and open a critical priority bugzilla against VE and component "java core".

--
Thanks, Rich Kulp

Re: VE 1.0: Possible Code Generation Mistake [message #582040 is a reply to message #20191] Fri, 20 February 2004 11:59 Go to previous message
Eclipse UserFriend
Hi Francesc,

> I have 2 JPanels in the ContentPane: panButtons and panFields.
> So the code generated is:
> jContentPane = new javax.swing.JPanel();
> ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===

Where did the duplicate line come from that adds getPanFields() a second
time as the Center constraint ? Did the VE generate that ?

Best regards,

Joe Winchester
Re: VE 1.0: Possible Code Generation Mistake [message #582148 is a reply to message #20215] Sat, 21 February 2004 06:34 Go to previous message
Eclipse UserFriend
Hi Joe,

First of all, sorry for my delayed answer. Yesterday
my disk crashes.

I think the line code is my fault.

I respond Rich Tulp with the steps to reproduce
the error.

Best regards,

Francesc

Joe Winchester wrote:

> Hi Francesc,

> > I have 2 JPanels in the ContentPane: panButtons and panFields.
> > So the code generated is:
> > jContentPane = new javax.swing.JPanel();
> > ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===

> Where did the duplicate line come from that adds getPanFields() a second
> time as the Center constraint ? Did the VE generate that ?

> Best regards,

> Joe Winchester
Re: VE 1.0: Possible Code Generation Mistake [message #582163 is a reply to message #20204] Sat, 21 February 2004 06:43 Go to previous message
Eclipse UserFriend
Hi Rich,

First of all, sorry for my delayed answer. Yesterday
my disk crashes. No comment...

I copy the steps to reproduce the error and the evolution
of "getJContentPane" code generation.

Best regards,

Francesc

================================== cut here =============================
1. JFrame (with main)
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}

2. Adding a new JPanel (panButtons) using the Choose Bean
Dialog. The panel is added at south:
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}
3. Adding a new JPanel (panFields) using the Choose Bean
Dialog. The panel is added at center:
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}

4. Adding a JButton (pbExit) using the Choose Bean
Dialog to the panButtons:
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}

5. Adding a JLabel (stName) using the Choose Bean Dialog
to the panFields:
private javax.swing.JPanel getJContentPane() {
if(jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
jContentPane.setLayout(new java.awt.BorderLayout());
}
return jContentPane;
}
================================== cut here =============================


Rich Kulp wrote:

> One thing, was it a typo below, but you one line that says
> ContentPane.add and not jContentPane.add


> Francesc Rosés wrote:

> > Hello,
> >
> > I'm testing VE 1.0 (I20040219) from W2K and I observe the
> > code generated for the "getJContentPane" method (I test it
> > in a JFrame) and it seems there is a possible little mistake.
> > I have 2 JPanels in the ContentPane: panButtons and panFields.
> > So the code generated is:
> > jContentPane = new javax.swing.JPanel();
> ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> <----------------- This line here, is this a typo?

> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
> >
> > I have no problems from the design view, but when I execute
> > the main method of this class the frame appears empty. I must
> > change the lines order in the "getJContentPane" method:
> > jContentPane = new javax.swing.JPanel();
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER); <===
> > ContentPane.add(getPanButtons(), java.awt.BorderLayout.SOUTH);
> > jContentPane.add(getPanFields(), java.awt.BorderLayout.CENTER);
> >
> > My JDK version is 1.4.2_03.
> >
> > Other observations:
> > - No VE perspective.
> > - The speed is spectaculary improved.
> >
> > Francesc Rosés
> >

> That shouldn't of occured. Can you reliably reproduce this? I tried on
> my own and couldn't. And if you can, please give the steps to do this
> and open a critical priority bugzilla against VE and component "java core".
Re: VE 1.0: Possible Code Generation Mistake [message #582199 is a reply to message #20232] Sat, 21 February 2004 19:43 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Ahh! We were focusing on what looked like a duplicate add(...) command,
but the real problem was calls created out of order.

As a matter of fact, we found your error while trying to reproduce your
results. We couldn't reproduce what the first note indicated (an extra
add component command) but we did see the out of order problem, and
we've fixed it.

It is https://bugs.eclipse.org/bugs/show_bug.cgi?id=52664

Thanks for bringing this to our attention.

--
Thanks, Rich Kulp

Previous Topic:NEWBIE: Compiling VE-generated classes
Next Topic:JInternalFrame visibility
Goto Forum:
  


Current Time: Wed Jun 04 11:32:46 EDT 2025

Powered by FUDForum. Page generated in 0.07695 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top