File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I get the users input?

 
ben riches
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If all you need to do is get a file name from the user, just use the JFileChooser.
 
ben riches
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2823
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic