473,320 Members | 2,097 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,320 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 1591
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.