473,422 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,422 software developers and data experts.

Please help I have problems regarding inputing a value into an array with gui

i have 2 classes 1 main with methods and a gui file on the mainfile I have an aDD method.
Expand|Select|Wrap|Line Numbers
  1. public void aDD(JTextField a, String[] r)
  2.     {
  3.         int x=0;
  4.         while(x<r.length)
  5.         {
  6.             r[x]=a.getText();
  7.             x++;
  8.         }
  9.  
  10.     }
  11.  
and on my gui I have 1 that returns values to the main method
Expand|Select|Wrap|Line Numbers
  1.  if (z.getSource()== add)
  2.         {   
  3.             a3.aDD(f,x);
  4.             f.setText("");
  5.  
  6.         }
  7.  
p.s.f=text area, x is a String array;
can u help me correct my mistake
Oct 29 '08 #1
7 1598
myusernotyours
188 100+
Hi,

Can you make your question a little bit more clear? It's difficult to tell what you are trying to do...

We are all willing to help, but only if we can understand your problem see this

Regards,
Alex.
Oct 29 '08 #2
my question is...when I add sumthin to my array the result is null can u fix my code plsss...
Oct 30 '08 #3
JosAH
11,448 Expert 8TB
my question is...when I add sumthin to my array the result is null can u fix my code plsss...
If you want us to help you you have to be less vague: *what* exactly turns out
to be null? The array itself? Elements in the array? Something else? Was it
null before? Where did you notice it was null?

kind regards,

Jos
Oct 30 '08 #4
If you want us to help you you have to be less vague: *what* exactly turns out
to be null? The array itself? Elements in the array? Something else? Was it
null before? Where did you notice it was null?

kind regards,

Jos
when a display button is clicked..the return value is null..only the first entry appears and the second remains as null
Oct 30 '08 #5
JosAH
11,448 Expert 8TB
when a display button is clicked..the return value is null..only the first entry appears and the second remains as null
Again: *what* return value? And ActionListener doesn't supply you with a return
value. A first and second entry of *what*? You do have to be as exact as possible.

kind regards,

Jos
Oct 30 '08 #6
the entries ion the array made by this add button..
Oct 30 '08 #7
JosAH
11,448 Expert 8TB
the entries ion the array made by this add button..
According to your code you put the same value in every entry (a.getText()). They
all should be equal. The getText() method can return an empty String "" but not
null. Or is there some other code that fiddles with the array values?

kind regards,

Jos
Oct 30 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Stingray | last post by:
Are there any know problems with using a MemoryStream as a backing store for a CryptoStream? I'm trying to simply encrypt and decrypt text in memory. I'd like to create some simple methods to...
3
by: s.subbarayan | last post by:
Dear all, I encountered the following piece of program: #include <stdio.h> void strprint(char *str); void main() { char *spr="hello"; strprint(spr); }
5
by: WesIdell | last post by:
Hi All: I need some advice regarding a problem that I'm experiencing. I'm using a group of TextBox controls in the .aspx page and am using a function in the .cs code to perform some actions with...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
6
by: enjoyincubus | last post by:
Hi there i have a problem in C which i cannot complete...can you guys help? Write a program that asks the user the ff: data full name address age
5
by: Kosmos | last post by:
Hey :) hopefully someone can help me with this...I decided to take on the task of programming an access database for my legal co-op/internship...I'm studying law and music production on the...
4
by: UMstudent | last post by:
I'm working on this program for class where I have to an amount of numbers that are randomly picked from 0 - 50. So what I have done is say there are 20 slots in my array so I'm trying to generator...
5
by: weidongtom | last post by:
Hi, I tried to implement the Universal Machine as described in http://www.boundvariable.org/task.shtml, and I managed to get one implemented (After looking at what other's have done.) But when I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.