• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How can I get the users input?

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic