Netbeans, but I'm not using GUI designer.
> > Which IDE are you (mis)using?
> Netbeans, but I'm not using GUI designer.
Avoiding the GUI designer is probably best,
until you get a good working knowledge of
Java layouts and general GUI techniques.
> > >...of MyPanel
> >
> > RenderPanel, ContentArea or LabelArrayPanel are
> > all better names ...
> That isn't real name of my class (PannelloGriglia is the name).
I like that name far *far* better than (cringe) MyPanel.
OK - perhaps for the sake of clarity, it might have been
better to refer to it by its actual (italian?) then put
in brackets your best translation (PanelGrill?).
When code is mentioned, many people prefer to
be discussing actual class names, especially for
the sake of avoiding confusion.
Andrew T.
lego_lax - 24 Sep 2006 21:36 GMT
> OK - perhaps for the sake of clarity, it might have been
> better to refer to it by its actual (italian?) then put
> in brackets your best translation (PanelGrill?).
Italian. It means GridPanel
> When code is mentioned, many people prefer to
> be discussing actual class names, especially for
> the sake of avoiding confusion.
Ok thanks.
I solved removing old panel and constructing a new one with right
numbers of components.
I am not sure if that is the best solution but it works.
Andrew Thompson - 25 Sep 2006 03:42 GMT
> > OK - perhaps for the sake of clarity, it might have been
> > better to refer to it by its actual (italian?) then put
> > in brackets your best translation (PanelGrill?).
> Italian. It means GridPanel
I suspected your translation would be better than my
tranlsation.. OK "Google Tranlsate's translation". ;-)
...
> I solved removing old panel and constructing a new one with right
> numbers of components.
Glad you sorted it.
> I am not sure if that is the best solution but it works.
I am still not sure of your entire requirement (some
GUI's would be better suited to a CardLayout - for
example, if you need the earlier panels again, you
can 'flip' to them very quickly), but removing old
components and adding new ones is a common
approach.
Don't forget to call validate() after a remove/add.
Andrew T.
lego_lax - 25 Sep 2006 12:59 GMT
> Don't forget to call validate() after a remove/add.
The GUI is updated both using validate() or updateUI(). Which is
difference?
Babu Kalakrishnan - 25 Sep 2006 22:59 GMT
>>Don't forget to call validate() after a remove/add.
>
> The GUI is updated both using validate() or updateUI(). Which is
> difference?
The updateUI() call is normally needed only if you're changing the UI
delegates of components - for example, if you switch Look and Feels at
run time.
A validate() call rarely helps when used by itself. (It performs a
validation only if swing thinks that the container's layout is in an
invalid state). You need to first call invalidate() followed by a
validate() for forcing a validation.
For Swing components, the best method to use after you've changed the
contents of a container is the revalidate() call (followed by a
repaint() ). However this method is not available in AWT
containers, so you'd have to use an invalidate() / validate() sequence
there.
BK
Brandon McCombs - 24 Sep 2006 23:50 GMT
>>> Which IDE are you (mis)using?
>> Netbeans, but I'm not using GUI designer.
[quoted text clipped - 10 lines]
>
> I like that name far *far* better than (cringe) MyPanel.
Well it isn't your program, he isn't going to change it just for you,
and you aren't his teacher so even if the real name was MyPanel you
would just have to deal with it.
> OK - perhaps for the sake of clarity, it might have been
> better to refer to it by its actual (italian?) then put
> in brackets your best translation (PanelGrill?).
The developer's preference for naming his class in this case did not
prevent sufficient clarity from occurring. His name contained "Panel"
which was sufficient to denote to us he was talking about a Panel
container. Just because it wasn't to your liking doesn't mean it wasn't
any less clear to us as to what he was talking about. He erred on the
side of simplifying his variables in order to get his point across and
as usual you picked out something from the post that was irrelevant to
fixing the problem and fixated on it.
> When code is mentioned, many people prefer to
> be discussing actual class names, especially for
> the sake of avoiding confusion.
For all you knew it was his actual class name until you questioned his
preference for choosing it because it didn't comply with your preference
and then he let it be known he changed it for the sake of this post.
Lionel - 25 Sep 2006 03:52 GMT
>>> Which IDE are you (mis)using?
>> Netbeans, but I'm not using GUI designer.
>
> Avoiding the GUI designer is probably best,
> until you get a good working knowledge of
> Java layouts and general GUI techniques.
Isn't it always? Every time I get the idea that maybe I can do something
faster in a gui designer I end up kicking myself and going back and
writing it by hand.
I feel as though Gui designers hide information from me, and they all
seem to store information in some other file which I assume probably
won't port to well . . . just my thoughts.
Lionel.
Andrew Thompson - 25 Sep 2006 05:01 GMT
> >>> Which IDE are you (mis)using?
> >> Netbeans, but I'm not using GUI designer.
[quoted text clipped - 4 lines]
>
> Isn't it always?
I don't *think* so, but have never had an opportunity to
prove that theory.
The thing is, if for example, you need to churn out
..dozens of GUI elements according to relatively
simple principles, for a single system, and assuming
you can lock in Java version and font sizes (probably
forgotten a couple of things).. the GUI designers
can be more productive.
I have never had much luck with GUI designers myself,
but feel they are gradually getting better, occasionally
check in them to see if I can make them work for me,
and do wish there were some way to design rugged
X-Plat GUI's by 'Drag & Drop'.
>...Every time I get the idea that maybe I can do something
> faster in a gui designer I end up kicking myself and going back and
[quoted text clipped - 3 lines]
> seem to store information in some other file which I assume probably
> won't port to well . . . just my thoughts.
NetBeans uses an XML description. I have also
worked with the SaverBeans screensaver project,
where our saver config. files are the same definition
of XML used by XScreenSaver.
A couple of notes about the XSS UI description files
and why I *like* them.
1) They are rendered by both CPP and Java
components, but the developer and end user
of a screensaver can view/edit them in a
plain text editor.
2) They are generally more terse (pre java
compilation - at least) than the equivalent Java.
1 general class (of around 20Kb) to render the GUI's
and hundreds of XML descirptions (around 2-3Kb each)
is ultimately smaller in bytes than the equivalent pure
Java classes.
3) Being XML, they are easily open to analysis/verification
by XSD (which can check UI layout) and XSLT (for
creating deployment web pages, webstart JNLP files..)
I am not inherently against using some way outside
core Java to store UI descriptions, it can have its
advantages, but I think it comes back to whether
the XML is 'portable' as you mentioned, and *rugged*
(to different system settings and user preferences).
Hopefully one of the NetBeans GUI designer gurus
will pop by and clarify where NB stands in relation
to portability of the XML descriptons ( and if so, at
what cost in bytes to the end user ;)
Andrew T.
lego_lax - 25 Sep 2006 13:03 GMT
> Isn't it always? Every time I get the idea that maybe I can do something
> faster in a gui designer I end up kicking myself and going back and
> writing it by hand.
I think it is not possible using designers to construct GUI components
at runtime, such as array of components of not predefined dimension.
Andrew Thompson - 25 Sep 2006 13:16 GMT
> > Isn't it always? Every time I get the idea that maybe I can do something
> > faster in a gui designer I end up kicking myself and going back and
> > writing it by hand.
> >
> I think it is not possible using designers to construct GUI components
> at runtime, such as array of components of not predefined dimension.
Sure it is. The screensaver component I was talking
about earlier*, produces GUI's that might look like this..
<https://screensavers.dev.java.net/config/#eg>
* It was was programmed using the NetBeans
form editor.