Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Arrays in Forte 3

  Asked By: Bill    Date: May 05    Category: Java    Views: 1099
  

Is it possible to create an array or collection of components in Forte 3,
instead of using a different name for each? I can't find a way to do it
without creating the components manually.

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Haru Tanaka     Answered On: May 05

What does Forte have to do with array  creation? Isn't that just an
IDE, I use an older version and just use a for-loop to create
multiple arrays, almost like creating  multiple fills for a single
array. Maybe that helps but i think i'm out in left field on this
one. In any case check out the java.util package.

 
Answer #2    Answered By: Jacob Evans     Answered On: May 05

I meant creating  an array  of components  using the gui editor. Currently I
just leave a blank space and create  the components using a for loop, but I
was wondering if there is a better way.

 
Answer #3    Answered By: Chaths Massri     Answered On: May 05

> I meant creating  an array  of components  using the gui editor.
Currently I just leave a blank space and create  the components using
a for loop, but I was wondering if there is a better way.


Again, I feel as if I am not understanding your exact needs, but I'll
give it a guess.

"Creating an array of components" --> utilizing a for(loop) is
standard practice and the best way, IMHO, for anything with more than
3-4 components.

What baffles me is your inclusion of "...I just leave a blank
space..." I'm guessing that you are not using Java Layouts and hand
laying your components on the "Absolute" ( <--- not exactly correct
for all you nit(nose)pickers) Layout. In this case there are far
better ways. Absolute layouts like the GUI Editor utilize a pixel
coordinate system that can cause programs that look great on your
system to become unusable on others... such as component overlapping
or frame edge cutoffs. If I'm still guessing right, hardly likely,
you are using the default layout: FlowLayout. There are several
more layout managers that can assist in placing components, some are
FlowLayout, GridLayout, BorderLayout (my favorite), Card Layout, and
the confusing, although very powerful GridBagLayout.

 
Answer #4    Answered By: Tarron Thompson     Answered On: May 05

With Forte it's quite easy to use the GridBagLayout, the layout manager that
I'm using. I first used AbsoluteLayout, but because it isn't included in the
default sdk and re, I stopped using it.

What I mean is I create  most of my objects using the GUI editor, that
automatically generates the code to add the components. Currently I'm
leaving a blank space with the GUI editor, and then manually  create the
array of buttons using a for loop.

 
Didn't find what you were looking for? Find more on Arrays in Forte 3 Or get search suggestion and latest updates.




Tagged: