This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is just that. Which bears out the point I've already made.
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic