• 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 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: 28193
95
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().
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic