|
-
while loop: keep all values
Hi. I use java swing to make a GUI. I have a while loop that run as long as there is something to read, and creates a JButton in each loop, pluss it incrases a value that will be sent to a file when the user press the button.
while(file is not empty)
{
create button;
add actionlistener
button_id=i++;
}
let's say there now is 3 buttons on the panel
then..
if (source = button)
{
send value button_id to another file
}
but only the last value is remembered, and only the last button created, is remembered, so how can i remember them all, and not only the last one? I donno if i explained propperly, but plz ask if something aint clear (i'm not english, so..:/)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks