Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 19th, 2003, 01:29 AM
linhtinh linhtinh is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Vietnam
Posts: 1 linhtinh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question What can I do to declare an array of TextField?

I have an applet have a panel with GridLayout with 5 rows and 5 cols. I want to place 4 first rows with TextField using for loop but it can't initialize. What can I do?
The code is like that:

public class Puzzle extends Applet {
Panel pan;
TextField[] tf1;
TextField[] tf2;
TextField[] tf3;
TextField[] tf4;
public void init()
{
pan=new Panel();
pan1.setLayout(new GridLayout(5,5,10,10));
for(int i=0;i<5;i++)
{
tf1[i]=new TextField();
pan1.add(tf1[i]);
}
for(int i=0;i<5;i++)
{
tf2[i]=new TextField();
pan1.add(tf2[i]);
}
for(int i=0;i<5;i++)
{
tf3[i]=new TextField();
pan1.add(tf3[i]);
}
for(int i=0;i<5;i++)
{
tf4[i]=new TextField();
pan1.add(tf4[i]);
}
add(pan1);
}
}

Reply With Quote
  #2  
Old July 14th, 2003, 08:01 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Unless I'm drunk and am missing the obvious (which is a possibility ), the code doesn't look wrong...

Are you receiving any error messages when compiling?
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > What can I do to declare an array of TextField?


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap