You can accomplish that using the GridBag layout manager, but that is quite
hard to use. A much easier layout manager to use is the GraphPaper layout
manager, which comes with the java tutorial.
I agree with you about the setting color for all the components of the panel.
There should be some default color scheme which you can implement to all
children of a particular frame.
Kontorotsui wrote:
> After extensive experience with Java GUI, mostly by using Swing, I wonder why
> there are hard tasks which can be accomplished very easily and easy ones which
> look almost impossible.
>
> Here are two examples.
>
> I have a grid with 3 buttons in the first row and 2 buttons in the third, I
> wanted to place the third row buttons centered, like this:
>
> XX XX XX
>
> XX XX XX
>
> XXX XXX
>
> but no layout manager allows to do it in a single panel, I had to do several
> panels.
>
> But the biggest example is this: suppose I have a JFrame subclass that
> represents my main window, it includes a menu bar and 5 panels with a border
> layout. If I want to make my window with a green background, I though I had to
> set the background color of the main window... instead I have to set the green
> background color to ALL the objects I put on the window.
> Why force each JComponent to have the standard grey background and black
> foreground, when it could have been, by default, the container one?
>
> Maybe I wrote a long series of mistakes and there are easy ways to do what I
> wanted to do (if case there are, please let me know), but the fact that after
> extensive search in the (mostly poor) documentation (the official Java
> tutorial!) and tests... if these are not Java faults, then it's the support.
>
> ---
> Andrea "Kontorotsui" Controzzi - MALE Student of Computer Science at
> University of Pisa - Italy - E-mail: [EMAIL PROTECTED]
> My home page: http://www.cli.di.unipi.it/~controzz/intro.html
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]