Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how would i put integers in my string array  RSS feed

 
mitchell cooper
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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},

 
Paul Clapham
Sheriff
Posts: 22493
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
Tony Docherty
Bartender
Posts: 3268
82
  • Mark post as helpful
  • send pies
  • 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().
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!