This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 22450

Summary: Pre-init code from component inspector aligned to 1 line
Product: platform Reporter: peterp <peterp>
Component: ExplorerAssignee: Jiri Rechtacek <jrechtacek>
Status: CLOSED FIXED    
Severity: blocker CC: mmirilovic, tpavek
Priority: P2    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:
Attachments: a implemented patch

Description peterp 2002-04-15 16:46:26 UTC
Win2000 SP2, JDK 1.4.0. Appears in FFJ3.0, FFJ4.0 EA 
build, netBeans build 200204150100.


1. add a ComboBox to JFrame 
2. Go on the ComboBox in the Inspector 
3. Choose the Code Generation Tab 
4. Go to >>Pre-Init Code<< and do the following Input (in 
Property Editor!!): 

   --- Begin --- 

  // Pre-Init ComboBox 
   jComboBox1.addItem("Winter"); 
   jComboBox1.addItem("Sommer"); 
   jComboBox1.addItem("Weihnachten"); 
   jComboBox1.addItem("Ostern"); 
   jComboBox1.addItem("Karneval"); 
   jComboBox1.addItem("Frühling"); 
   jComboBox1.addItem("Herbst"); 

  --- End --- 

  5. Return, and in Source-Code it seems that all things 
are well! 
  6. Look again on Pre-Init Code line
  7. The whole content is now in one line and if you click 
in the Property Editor you can see it. 
  8. The bad is, that the source code makes the same, that 
means, now the eight lines of code above is  >>one<< 
comment line.

[FFJ CUSTBUG] This bug was entered by FFJ customer
Comment 1 _ ttran 2002-04-16 07:19:02 UTC
-> form module
Comment 2 Tomas Pavek 2002-04-16 11:16:14 UTC
Strange, it works with JDK 1.3.1, but not on JDK 1.4.0.
Comment 3 Tomas Pavek 2002-04-16 11:36:38 UTC
But it looks like property sheet is the one who corrupts 
the String - removes line ends... Reassigning to 
openide/explorer for further investigation.
Comment 4 _ ttran 2002-04-16 12:38:45 UTC
-> akemr
Comment 5 Jan Zajicek 2002-04-18 15:04:07 UTC
Please enter correct version of the product.

Alesi, please evaluate this one ASAP, thanks.
Comment 6 Marian Mirilovic 2002-04-18 17:42:39 UTC
This is bug in JDK 1.4, JTextField

http://developer.java.sun.com/developer/bugParade/bugs/4670767.html


Comment 7 Tomas Pavek 2002-04-18 18:03:49 UTC
Þ
Comment 8 Jiri Rechtacek 2002-04-18 18:11:40 UTC
typo in mail address
Comment 9 Jiri Rechtacek 2002-04-18 18:16:14 UTC
Created attachment 5474 [details]
a implemented patch
Comment 10 Jiri Rechtacek 2002-04-18 18:20:23 UTC
workaround of jdkbug #4670767; JTextField filters the new lines if the
property filterNewlines is TRUE which is TRUE as default, for now
filterNewlines is set to null, the new lines are not removed. fixed in
main trunk
Comment 11 Marian Mirilovic 2002-04-19 09:38:14 UTC
Maybe better solution from JDK team is :

JTextField tf = new JTextField();
tf.getDocument().putProperty("filterNewlines", Boolean.FALSE);

see appropriate issue in bugtraq.



only a side effect, you can set file/package name more than one line
long

verified in [nb_dev](20020419)
Comment 12 Jiri Rechtacek 2002-04-19 10:29:25 UTC
fixed in orion_fcs
Comment 13 Jan Zajicek 2002-04-22 15:41:22 UTC
Verified in Orion too.
Comment 14 Quality Engineering 2003-07-01 16:16:12 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.