🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19720

Re: Array of Buttons

#19720
From: gman1
Date: Tue, 06 Jan 1998 00:00
60 lines
1906 bytes
here it is 1 dimensionally

  Button datebuttons[] = new Button[7];

init()
{
 datebuttons = new Button [7];
 for (int i=0;i<7;i++)
 {
  datebuttons[i]= new Button();
 }
}

you must use init(), or it doesn't work the way you wanted to do it....

gman1 wrote:

> I got this example to work 2 dimensionaly, but don't understand either?
> Can this example work 1 dimensionally?  Someone please explain this
> further....
>
> Eric Nagler wrote:
>
> > But why is a 2-dimensional array needed? What's wrong with this?
> >
> > import java.awt.*;
> > public class Main
> > {
> >   private static final int SIZE = 3;
> >   public static void main(String args[])
> >   {
> >     Button[] butt = new Button[SIZE];
> >     for(int i = 0; i < SIZE; ++i)
> >       butt[i] = new Button();
> >   }
> > }
> >
> > On Thu, 18 Dec 1997 12:05:54 -0700, cmm <cmavros@dmwgroup.com> wrote:
> >
> > >  Button [][] datebuttons;
> > >
> > >init(){
> > >  datebuttons = new Button [7][7];
> > >    for (int i=0;i<7;i++){
> > >      for (int j=0;j<7;j++){
> > >        datebuttons[i][j]= new Button();
> > >       }
> > >    }
> > >}
> > >
> > >
> > >cmm wrote:
> > >
> > >> Is it possible to have an array of buttons? Examples?
> > >>
> > >> CMM
> > >
> > >
> > >
Technical Details
Message-ID: <34B2CA9B.FAB7EAFA@enter.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34996C26.AD9BFFA@dmwgroup.com> <34997412.3981F484@dmwgroup.com> <34a36507.35514175@forums.borland.com> <34B2C78D.5DE8DCD@enter.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,901088dcdfd2f2a4
X-Google-Attributes: gidf74b3,public
From: gman1 <gman1@enter.net>
Subject: Re: Array of Buttons
Date: 1998/01/06
Message-ID: <34B2CA9B.FAB7EAFA@enter.net>
X-Deja-AN: 313454608
Content-Transfer-Encoding: 7bit
References: <34996C26.AD9BFFA@dmwgroup.com> <34997412.3981F484@dmwgroup.com> <34a36507.35514175@forums.borland.com> <34B2C78D.5DE8DCD@enter.net>
Mime-Version: 1.0
To: gman1 <gman1@enter.net>
Content-Type: text/plain; charset=us-ascii
Organization: None
Newsgroups: borland.public.jbuilder.java.language