Hello There!

my two cents. [?]

char a ='B';
while(a < 'Z') {
    a++; // Most be here, otherwise u will get an infinity loop :P ...
    mPanel.add(new Button(*Character.toString(a)*);
}

by the way, I advise you to use JButton (from Swing API) instead Button
(AWT).





On Mon, Nov 23, 2009 at 2:34 PM, Karl <karlk...@yahoo.com> wrote:

>        char a;
>        a = 'B';
>        a++;
>        while (a < 'z') {
>            mPanel.add( new Button("" + a) );
>        }
>
>
>
> --- On Sun, 11/22/09, tedpottel <tedpot...@gmail.com> wrote:
>
> > From: tedpottel <tedpot...@gmail.com>
> > Subject: [java ee programming] Trying to store a char in a string
> > To: "Java EE (J2EE) Programming with Passion!" <
> java-ee-j2ee-programming-with-passion@googlegroups.com>
> > Date: Sunday, November 22, 2009, 3:01 PM
> > Hi,
> > I'm trying to creat a row of buttons with the letters a to
> > z in them,
> > hear is my code
> >     char a;
> >         a='B';
> >         a++;
> >         while(a<'z')
> >         {
> >         String set= new
> > String(a);
> >         mPanel.add( new
> > Button(set) );
> >         }
> > The line
> > String set= new String(a);
> >  has a error, no constructer.
> > Is there a way to store a char in a string?
> > Or another soultion to my code block?
> > Ted
> >
> > --
> > You received this message because you are subscribed to the
> > Google
> > Groups "Java EE (J2EE) Programming with Passion!" group.
> > To post to this group, send email to
> > java-ee-j2ee-programming-with-passion@googlegroups.com
> > To unsubscribe from this group, send email to
> > java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com<java-ee-j2ee-programming-with-passion%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
> >
> http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
> >
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Java EE (J2EE) Programming with Passion!" group.
> To post to this group, send email to
> java-ee-j2ee-programming-with-passion@googlegroups.com
> To unsubscribe from this group, send email to
> java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com<java-ee-j2ee-programming-with-passion%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
>
> http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

<<330.gif>>

Reply via email to