This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

vectors  RSS feed

 
Chris Roberts
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While using vectors, I came up with the following questions:

1. How do you place a string in a vector after allowing the user to enter
the string in a input dialog frame?


2. If the user clicks ok without entering a string in the dialog frame, how do you return this empty string ("")?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Chris!

1. How do you place a string in a vector after allowing the user to enter
the string in a input dialog frame?


Nevermind the input dialog, do you know how to place a String in a Vector? Could you post some example code?

When posting code, please be sure to surround the code with the [code] and [/code] UBB Tags. This will help to preserve the formatting of the code, thus making it easier to read and understand.

Concerning the input dialog, do you know how to get the input String from the input dialog? Can you write a simple example program that echos input from a dialog?

I'm thinking that the answer to your next question might become more apparent after exploring the above issues.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It won't help you with your problem, but I can't help but note a budding bad habit - Don't use Vector, use ArrayList.

- Peter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!