wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes How can I get the users input? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How can I get the users input?" Watch "How can I get the users input?" New topic
Author

How can I get the users input?

ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
Hello All,
In this piece of code it reads in a file (work.csv), and then counts how many rows are in the file, which is fine. but I want to be able to get the users input so they can read in what file they want. ie when the user types in the directory of there file, the JTable rows will then resize to the amount of rows in there file. At the moment the code is always set to read in the work.csv file.
Could someone be so kind and help me solve this little problem
Thanks
Ben
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

If all you need to do is get a file name from the user, just use the JFileChooser.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
Hello Nathan,
I am having great trouble construsting and using this class in my currnt code could you please help me.
Thanks
Ben
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
What is it that you are having problems with? What have you tried and what is happening. The link Nathan gave you is to the tutorial on using file choosers.
ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
Hello Paul,
Well the problem I am having that I do not want to use the file chooser,
All I want to have is a text field where the user can type in there file that they want to upload. After they have typed in the file name they then can click a submit button to read in the file, with this reading in of the file, the JTable rows need to change to the size of how many rows are in the file. the number of rows in the file is stored in a int called num.
Hope you can help.
Thanks
Ben
 
 
subject: How can I get the users input?
 
Similar Threads
Can I set up a JTable columns?
color in cell
Stii having problems
How can I add rows in a Jtable
JFileChooser