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.
Summary: | Matisse does not handle custom jPanel childrens properly | ||
---|---|---|---|
Product: | guibuilder | Reporter: | alexroat <alexroat> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | RESOLVED INVALID | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Sample code of the Bug
SORY IS THIS ONE --> Sample code of the Bug |
Description
alexroat
2007-06-11 15:35:35 UTC
Could you provide more information about ide build, jdk, os? thanks Of course, I'm using Netbeans 5.5.1 for linux (installer binary netbeans-5_5_1-linux.bin ) on a ubuntu linux 7.04 Feisty Fawn. The Jdk istalled is Java6 (I've got java-6-sun and java-6-sun-1.6.0.00 subdirs in /usr/lib/jvm). Many thanks. Sorry, but I don't quite understand what the problem is. You don't see what you expect when you run the form, or only in the design? Is the generated code in initComponents method correct? Could you possibly attach the project here? Created attachment 44433 [details]
Sample code of the Bug
Created attachment 44435 [details]
SORY IS THIS ONE --> Sample code of the Bug
Hi, sorry but I was away for a short vacation :-) Ok, I've compressed the example in this tar.gz archive that contains the project folder, put it in your your NB workspace and import it. As you can see I've added a new Jpanel derived class called MyPanel (matisse based) in the main package and the main frame MyFrame aside the startup class Main. I've drawed a simple jlabel and jbutton into MyPanel using matisse editor. In the MyFrame I've putted a JButton istance jButton1 and a JPanel instance jPanel1 using Matisse Editor. I've then changed the jPanel1 construction code in the tabs of right side of Matisse Designer putting "new MyPanel();" in the Custom Creation Code field. Building and launching the application you can only see a naked JPanel without childrens. Why ? I need to substitute the common JPanel instance with a MyPanel instance referred by jPanel1 variable, otherwise what's is usefull for the possibility to edit a JPanel derived class by Matisse editor ? PS: sorry for the confusion in the attachments, the right one is the latest, watch the attachments description and please ignore the other one. Please let me know if there's still something unclear. Regards Alex I see now. The problem is that jPanel1 in MyFrame has a layout code generated (GroupLayout) - setting layout causes the components are removed. The GUI builder unfortunately does not know there is a different container with its own layout since it is specified only via custom code and not really instantiated in the GUI form. However you can fix this easily - just set the layout of the jPanel1 in MyFrame to Flowlayout. This is default layout of JPanel, so the GUI builder will not generate any layout code and your custom panel will be left intact. As for avoiding installation to palette - in NB 6.0 you can just drag MyPanel from project explorer onto the target form. Even in 5.5.1 you should be able to do copy the file from explorer and paste it in the form (MyFrame node in Inspector). Note you need MyPanel compiled for this. So this is a bit confusing, but actually not a bug. We can't base the layout code generation on whether there is a custom creation code or not. So I will close this issue. |