Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

Swing UI designer - "Foam"

Thread view: 
Graham Perks - 08 Jan 2004 06:11 GMT
Foam is an easy-to-use Java GUI development system, featuring
simplified GUI building without traditional layout headaches. Foam
separates GUI designs from Java code.

No more GridBagLayout... With Foam you have easy design and
maintenance!

One good way to find out what Foam can do is to view the demonstration
movies at our web site. Another way is to download a free trial of
Foam!

You can purchase Foam and download trials from our web site at
http://www.computersinmotion.com

Signature

Cheers,
Graham Perks

hiwa - 08 Jan 2004 11:04 GMT
The demo crashes/freezes whole windowing system on Linux.
Graham Perks - 08 Jan 2004 13:44 GMT
> The demo crashes/freezes whole windowing system on Linux.

That's bad!  It's just regular Flash.  What browser are you using, so
we can test it out? Which demo - any of them?

The Linux version of Foam is in test right now, and will be out later
this month.

--
Cheers,
Graham Perks.
Brandon Blackmoor - 08 Jan 2004 16:50 GMT
>> The demo crashes/freezes whole windowing system on Linux.
>
> That's bad! It's just regular Flash.

No surprise there: that's what Flash does. Personally, I think Flash is
evil (and not in a good way), which is why I uninstalled it, and
recommend that others do the same.

bblackmoor
2004-01-08
Andrew Thompson - 08 Jan 2004 20:37 GMT
| > The demo crashes/freezes whole windowing system on Linux.
|
| That's bad!  It's just regular Flash.

Why is the demo not in regular ..Java?
Graham Perks - 09 Jan 2004 00:57 GMT
> "Graham Perks" <anon@a.z> wrote in message
> | It's just regular Flash.
>
> Why is the demo not in regular ..Java?

There is a free trial download; that makes a very good Java demo :-)

With Flash, which most people can view, we can have the voiceover and
show off certain features which otherwise might be overlooked,
especially in such a concise amount of time. For a longer look, there
is the trial download of the product.

http://www.computersinmotion.com

--
Cheers, Graham Perks.
Nick Howes - 10 Jan 2004 22:01 GMT
> No more GridBagLayout... With Foam you have easy design and
> maintenance!

What's wrong with GridBagLayout?
ak - 11 Jan 2004 02:00 GMT
> What's wrong with GridBagLayout?

First wrong thing is the name - right name could be "GridBadLayout" ;-)
GBL is perfect thing if you wanna total chaos in your code.
And it works (almost) not as expected.

____________

http://reader.imagero.com the best java image reader.
Graham Perks - 11 Jan 2004 02:30 GMT
> > What's wrong with GridBagLayout?
>
> First wrong thing is the name - right name could be "GridBadLayout" ;-)
> GBL is perfect thing if you wanna total chaos in your code.
> And it works (almost) not as expected.

Right... I've heard "BarfBagLayout" as well!

You know what's wrong when you have to spend half an hour staring at
some code trying to figure out where to modify it in order to move a
group of buttons up *there*, add an extra one, and insert a new lable.

Look at any dialog. Do you see rows and columns? No, nor do I. Why
should all the beans have to fit into some arbitrary row & column
scheme?

Give Foam a try and I think you'll never want to fight with GridBag
ever again.

Cheers,
Graham Perks
http://www.computersinmotion.com
Jim Sculley - 11 Jan 2004 03:39 GMT
>>>What's wrong with GridBagLayout?
>>
[quoted text clipped - 7 lines]
> some code trying to figure out where to modify it in order to move a
> group of buttons up *there*, add an extra one, and insert a new lable.

Sounds like the design wasn't thought out up front.  And the code was
poorly written if you have to 'figure out' where to modify it.

> Look at any dialog. Do you see rows and columns? No, nor do I. Why
> should all the beans have to fit into some arbitrary row & column
> scheme?

They don't.  GBL isn't about components in rows and columns.  The grid
represents areas of the available space.  Some components fit nicely
into a single cell of the grid.  Others span one or more cells both
horizontally and vertically.  Components can be aligned in a variety of
ways to the edges of the cells.  It's really not that difficult.

> Give Foam a try and I think you'll never want to fight with GridBag
> ever again.

I've rarely fought with it in the past.

Jim S.
hantheman - 26 Jan 2004 22:52 GMT
Hey, Jim, listen up:

GRIDBAGLAYOUT SUCKS BIG TIME.

> >>>What's wrong with GridBagLayout?
> >>
[quoted text clipped - 27 lines]
>
> Jim S.
Graham Perks - 29 Jan 2004 02:04 GMT
> Hey, Jim, listen up:
>
> GRIDBAGLAYOUT SUCKS BIG TIME.

ROTFL!

Today's best post!

--
Cheers,
Graham Perks
http://www.computersinmotion.com
Karsten Lentzsch - 27 Jan 2004 11:30 GMT
> You know what's wrong when you have to spend half an hour staring at
> some code trying to figure out where to modify it in order to move a
> group of buttons up *there*, add an extra one, and insert a new lable.

GridBagLayout defines its grid while filling it;
that seems to make these layouts harder to understand.
The last component added can change the whole grid.
Hence you have to read a GridBagLayout builder code
completely to build a mental layout - similar to an
interpreter you've to read every constraints object
and add it to the current state.

In my layout courses I've found that developers could
work faster with the TableLayout. Unlike GBL, the
TableLayout allows to define the grid first, then you
add the components.

If you can define the grid, or more generally, the
big structure, statically, you have fixed 'mental costs'
for understanding it. With a dynamically defined grid
the mental costs are linear with the number of components.

> Look at any dialog. Do you see rows and columns? No, nor do I. Why
> should all the beans have to fit into some arbitrary row & column
> scheme?

Although they are often invisible, developers talk about
rows and columns. And let developers lay out an editor
with a leading label column and 5 rows for ...
Can you see the rows? But do you see how natural it is
to describe a form with columns and rows.
Back to the developer: let him lay out the editor and
let her paint a draft on a paper. Guess how many people
draw a grid before they start filling it?

For quite a long time grids have been an effective means
to describe readable layouts. In 1470 some monks in Paris
have set up a style guide for how to use the brand new
Gutenberg technique. Basically they found a grid useful
with a set of equally sized lines (or rows) where glyphs
are aligned along an invisible line, what we call today
the font baseline.

In the traditional print media industry, grids help designers
save time and money. More than that, grid systems help a team
focus on content, not structure - while ensuring consistency.
(In a well crafted book both sides of the paper are aligned
in this way, so that you can read the words quickly even
if the light shines through the paper.)

You can find good introductions about grids and grid systems
in the work of Jan Tschichold, Josef Mueller-Brockmann or
Ruedi Ruegg. Kevin Mullet and Darrel Sano present a layout
system for widget toolkits that is based on grid systems or,
in their wording, design modules.

Hope this helps,
Karsten Lentzsch
JGoodies :: Java User Interface Design
Karsten Lentzsch - 11 Jan 2004 12:37 GMT
> What's wrong with GridBagLayout?

GridBagLayout makes simple things difficult
and the hard stuff _impossible_.

I provide a whitepaper that discusses some of its weaknesses.
And I offer presentations and demos that show screen design
essentials that you cannot implement with the GridBagLayout:
http://www.jgoodies.com/articles/layout-essentials.pdf
http://www.jgoodies.com/articles/forms.pdf
http://www.jgoodies.com/articles/

In may layout courses I have found that many developers
have difficulties to understand the GridBagLayout, to
work with it and to implement well designed screens.
The majority of developers end up with poor design,
it takes quite a lot of time and they become frustrated
about both the design result and their productivity.

So, from my perspective a design process support
like Foam can help people get better screen design
and produce layout faster.

It seems to me that many developers think that the
GridBagLayout can implement the everyday-layout-tasks.
But from the GBL's concepual complexity it doesn't follow
that it can implement complex design. The contrary is
the case. GBL is one of the weaker layout managers.
SpringLayout is powerful - but difficult to use.
HIGLayout is quite powerful.
ExplicitLayout is powerful.

Hope this helps,
Karsten
Tor Iver Wilhelmsen - 12 Jan 2004 19:05 GMT
> GridBagLayout makes simple things difficult
> and the hard stuff _impossible_.

Er, no. Not within the confines of an IDE designer. I've used it a lot
with JBuilder since JBuilder 2 back in 1998. Not problematic at all.
ak - 12 Jan 2004 23:01 GMT
> > GridBagLayout makes simple things difficult
> > and the hard stuff _impossible_.
>
> Er, no. Not within the confines of an IDE designer. I've used it a lot
> with JBuilder since JBuilder 2 back in 1998. Not problematic at all.

can you understand such generated code?
It is horrible - jLabel35, jTextField97, jComboBox11 - and unmaintable, cos
you need hours to understand and refactor it.

____________

http://reader.imagero.com the best java image reader.
ak - 12 Jan 2004 23:06 GMT
> > > GridBagLayout makes simple things difficult
> > > and the hard stuff _impossible_.
[quoted text clipped - 5 lines]
> It is horrible - jLabel35, jTextField97, jComboBox11 - and unmaintable, cos
> you need hours to understand and refactor it.

if you want just spare your money (no more code obfuscator needed), then it
is really usefull thing.
then this page http://mindprod.com/unmain.html could be helpfull.

____________

http://reader.imagero.com the best java image reader.
Jim Sculley - 12 Jan 2004 23:17 GMT
>>>GridBagLayout makes simple things difficult
>>>and the hard stuff _impossible_.
[quoted text clipped - 5 lines]
> It is horrible - jLabel35, jTextField97, jComboBox11 - and unmaintable, cos
> you need hours to understand and refactor it.

If you were too lazy to name the widgets when you added them, it's not
the GUI builder's fault.

Jim S.
ak - 13 Jan 2004 01:07 GMT
> >>>GridBagLayout makes simple things difficult
> >>>and the hard stuff _impossible_.
[quoted text clipped - 8 lines]
> If you were too lazy to name the widgets when you added them, it's not
> the GUI builder's fault.

sorry, I never used  GUI  builder (ok I used, but only with VB), but I have
refactored code from another people - and _it_was_horrible_.

____________

http://reader.imagero.com the best java image reader.
Graham Perks - 13 Jan 2004 02:03 GMT
> sorry, I never used  GUI  builder (ok I used, but only with VB), but I have
> refactored code from another people - and _it_was_horrible_.

And that's why, even if some programmers can code GridBagLayout in
their sleep in Java code, we need visual tools. Because we all have to
maintain Java and it's just a terrible way to represent a visual
design.

No matter how fast you are at GridBag, or Box, or Border, or whatever
in code, you are going to be quicker, faster, and have an easier time
in a good visual designer. You'll be more creative and more willing to
try alternate designs out. Chances are, that will show in your
interfaces.

I believe part of the reason many Swing applications don't look so hot
is because the UI is so hard to change. Once it's in Java, the UI is
hard to modify - it's certainly no fun. So, it stays, warts and all.

If you're looking for a good visual designer for Swing (one that
doesn't just replicate all the problems you have with GridBag today),
take a look at Foam.  It gives you easy visual layout, with one line of
code to create your panels and have all the layout done. One line! How
hard is that to maintain? :-)

Foam works on Mac and Windows, with Linux support on the way.

Cheers,
Graham Perks
http://www.computersinmotion.com
Jim Sculley - 13 Jan 2004 02:39 GMT
>>>>>GridBagLayout makes simple things difficult
>>>>>and the hard stuff _impossible_.
[quoted text clipped - 14 lines]
> sorry, I never used  GUI  builder (ok I used, but only with VB), but I have
> refactored code from another people - and _it_was_horrible_.

Perhaps.  I've seen horrible code from other peopel that *wasn't*
automatically generated.  That's my point.  The GUI builders I've used
allow you to name the widgets logically just like in hand written code.
 There is no reason why generated code is automatically more difficult
to read than hand written code.  In fact, I currently code (by hand) my
GUIs using patterns  I learned while using a GUI builder in the past.

Jim S.
ak - 14 Jan 2004 10:02 GMT
> If you were too lazy to name the widgets when you added them, it's not
> the GUI builder's fault.

it is not only lazyness - see
http://www.javaworld.com/javaworld/jw-10-2002/jw-1004-dialog.html

--

____________

http://reader.imagero.com the best java image reader.
Karsten Lentzsch - 13 Jan 2004 09:08 GMT
>>GridBagLayout makes simple things difficult
>>and the hard stuff _impossible_.
>
> Er, no. Not within the confines of an IDE designer. I've used it a lot
> with JBuilder since JBuilder 2 back in 1998. Not problematic at all.

That's a popular fallacy.

GridBagLayout cannot implement a bunch of essential
screen design tasks. I provide several examples in
presentations and in a live demo that you can't do
with the GridBagLayout - with or without IDE designer.

Simple things:
o Build a panel with two JLists, both equally sized.
o Build a form with three rows, each with equal height,
  even if you mix a text field, button, or combo.
o Build a symmetric panel.
o Build two panels for use in a tabbed pane that do
  not 'jump' to the left and right if you switch tabs.
o Build a panel with an OK button that has a well
  designed minimum size, let's say 50 dialog units.

Hard stuff:
o Build a button bar with OK, Cancel that ensures
  minimum widths as required by the MS layout style
  and that uses the logical gap for related components.
o Build a button bar with OK, Cancel, Apply that honors
  the platform button order: left-to-right vs. right-to-left.
o Build a panel with label and text field,
  font baselines aligned.
o Build a panel with label, text field and button,
  font baselines aligned, perceived bounds centered.

Actually, GridBagLayout can do all of the above
if you use a fixed font, fixed font size, fixed
rasterizer, fixed screen resolution, and fixed l&f
 - but then a null-layout would be simpler.

GridBagLayout does not retain _proportions_ if you
change the font, font size, or screen resolution,
since it has no means to describe non-pixel sizes.
GridBagLayout cannot ensure that two columns/rows
get the same size. GridBagLayout cannot ensure a
non-pixel minimum size.

You can see most of the above examples in this presentation:
http://www.jgoodies.com/articles/layout-essentials.pdf
Here are everyday layout tasks, some impossible for GBL:
http://www.jgoodies.com/freeware/formsdemo/
A more thorough discussion of Java layout problems
is available in the following whitepaper:
http://www.jgoodies.com/articles/forms.pdf

Best regards,
Karsten
Roedy Green - 13 Jan 2004 22:21 GMT
>GridBagLayout cannot implement a bunch of essential
>screen design tasks.

On the other hand, I have found that when I designed using the
cascades of simpler layout managers, in the end I could never get them
to behave completely correctly.  I ended up flipping them to
GridBagLayouts to satisfy the customer.

I regard you as the probably the world's leading expert on layouts.
What I probably should do is fork over the money for your
GridBagLayout replacements and take the time to learn them too.
I find employers strongly dislike using any commercial software in
their designs, no matter how cheap it is. They have been burned too
many times by companies like Oracle or Rogue Wave.  They want source.

What I want is something highly intelligent that works like this:

I drag the elements around positioning absolutely.  I then resize the
frame.  I then redrag the element around positioning absolutely.  The
program then does some sort of intelligent interpolation, creating
something like a GridBagLayout for me.  Then I resize the frame, and
tweak the positionings for a few more sizes to fine tune the result.
The end result looks in code much like a traditional GridBagLayout,
perhaps with some additional hex gibberish not intended for human
consumption.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Roedy Green - 13 Jan 2004 23:07 GMT
>Then I resize the frame, and
>tweak the positionings for a few more sizes to fine tune the result.

It cleans up any off by 1 pixel errors, perhaps offering me the option
of saying "NO I really meant that."

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Karsten Lentzsch - 13 Jan 2004 23:43 GMT
> On the other hand, I have found that when I designed using the
> cascades of simpler layout managers, in the end I could never get them
> to behave completely correctly.  I ended up flipping them to
> GridBagLayouts to satisfy the customer.

I cascade as less as possible and as often as necessary.
For example, I separate prebuilt subpanels: button bars,
button stacks and a compound header.This often reduces
the complexity of the layout grid significantly.

> I regard you as the probably the world's leading expert on layouts.
> What I probably should do is fork over the money for your
> GridBagLayout replacements and take the time to learn them too.
> I find employers strongly dislike using any commercial software in
> their designs, no matter how cheap it is. They have been burned too
> many times by companies like Oracle or Rogue Wave.  They want source.

Since the JavaOne 2003 the JGoodies Forms are open source,
are available at no charge, and I support and maintain it.
The same is true for the JGoodies Looks that I feel necessary
to improve the micro design, e.g. widget bounds, perceived
bounds alignment, etc. Forms is maintained at JavaDesktop.org.

I invest the product revenues from my Swing Suite and
money from sponsors into free open source desktop libraries.

Karsten


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.