• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

how would i put integers in my string array

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
heres my project could someone please point out how I would get integers in my string array for example ({"john","blue","male", 367, 86,48},

 
Marshal
Posts: 27450
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But you don't have a String array containing those things. You have an Object array. So:



If that data's going into a JTable then you may well have more questions about how to deal with columns of different type, you should really pause for a while and go through the Oracle tutorial: How to Use Tables. A lot of beginners, when writing a Swing application, just start writing code, but that really isn't sufficient. If you don't understand the design requirements behind Swing a bit then you're going to flounder when deciding what code to write.
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My advice would be stronger than Paul's (because I have answered a question on this code in another thread) and I'd say stop coding right now.

In the other thread I pointed out how you could get data to show in your table by removing the call to initComponents(). This was definitely not a solution, it was to help you find your code issue. Please do not write any more code until you have figured out your initial problem. To give you another hint your code creates 2 JTables but only 1 is displayed and the one that is displayed changes if you include the call to initComponents().
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic