• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to use a custom panel that has already been laid out with components in Matisse?  RSS feed

 
Mae Tan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I have a JPanel that I've customized with components, i.e. buttons laid out with gridbag, using Matisse. When I use this custom panel in another panel still using Matisse, I find that none of the buttons on my custom panel appear. When I look into the Matisse code, I see that my custom panel has been applied with GroupLayout. Is there a way to stop Matisse from doing this? Is it possible to use a custom panel that has already been laid out with components in Matisse?

Thanks,
Mae
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another reason why not to use drag and drop style GUI builders. Hand coding is the way to go.

Hand coding is as simple as:
Subclass JPanel.
Set appropriate layouts. You can even nest different combinations of layouts.
Add components.
Reuse.

If you are starting to hand code for the first time, a very useful trick is to draw on paper, how you want your panel to appear. Then break it down to small visual sectors. These sectors will give you an indication of the layouts you will need to use.
More on layouts here http://download.oracle.com/javase/tutorial/uiswing/layout/visual.html
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a choice here:

A) Spend a few days learning how to use layouts and manually code your GUI
OR
B) Spend a few months learning the quirks of Matisse and how to achieve the same results with largely unreadable code
 
Mae Tan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies. I just wanted to make sure it was not some NetBeans settings that I have to apply and haven't figured out yet.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is just that. Which bears out the point I've already made.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!