-14

I am still learning about how StackOverflow works, and I found a question that was put on hold for "unclear what you're asking" when it seems fairly apparent what the asker wanted to me. They wanted to get a String from an Object, and turn it into a String array.

I am not sympathetic to the asker, as they clearly didn't put a lot of effort in the question. There are lots of problems with the question, and given the simplicity of it, I suspect it is likely a duplicate. I don't disagree with it being put on hold. However, I am curious why it was put on hold as unclear specifically.

The question has been edited, but only to correct the asker's grammar, and add a code block.

I am not here to argue. I want to know this so I can improve my own questions.

Why was this question put on hold for being unclear?

The Question

0

4 Answers 4

12

There was plenty of confusion in the now deleted comments of this meta question as to what this question is asking, but if that's not enough evidence that it is actually unclear, let me break the question down a little:

How can I assign a string that I'm getting from a TextField as a string array variable in JavaFX?

I hope the question makes sense. I tried assigning it as below but it does not work. I greatly appreciate the help.

TextField listTextField = new TextField();
String[] listTextField.getText() = new String[] {"hi", "hello"};

Let's take the title for starters:

How can I assign a string that I'm getting from a TextField as a string array variable in JavaFX?

This could mean:

  • The user wants to get a string from a TextField and store it as a string array. The only way this could make sense is if they wanted a new String[] variable and to store an array of length 1 into it. Neither of those two things are clear by the question; the array they're storing is clearly of length 2, and they don't create a new String[], they try to redefine the existing listTextField as a String array, so it's not clear that this interpretation is the right one.

  • The user possibly ordered their words unclearly, and "a string that I'm getting" refers to a string they've obtained previously in the program and not the contents of the TextField, and they want to store that previously obtained String into an array contained by the TextField. This makes a little more sense with the code they attempted, but that still leaves us confused as to why there's an array of length 2 when they're referring to a single String.

  • Trying to use the comment for clarification "i'm building a javafx project. i'm suppose to get an input from a user using javafx then use the input as an array variable in my program." The phrase "use the input as an array variable" really doesn't make sense. Maybe that pushes it back to the first interpretation, but as mentioned, that one is unclear.

Now let's move to the body of the post.

I hope the question makes sense. I tried assigning it as below but it does not work. I greatly appreciate the help.

  • "I tried assigning it as below" The user tried assigning the return value of the .getText() method... as an array? If they hadn't used the pronoun "it", then maybe they could have clarified what it was that they meant to actually assign. At this point, we don't know if the user needs instruction on what a String array is, or why .getText() doesn't return a String array, or why the String[] listTextField.getText() isn't a valid definition of some getText() function.

  • "but it does not work." What didn't work? What was the error message? I mean, obviously this code won't even compile, but the close reason asks the user to "highlight exactly what you need." They haven't highlighted what they need, just told us it didn't do what they wanted without telling us what they wanted.

  • "I hope the question makes sense. I tried assigning it as below but it does not work. I greatly appreciate the help. " Two thirds of their question's textual explanation is meaningless fluff. The entirety of their question is the title and the vague phrase.

If you think you have interpreted what the user really needs, you are reading between lines. There is nothing in the content of this question, nor in the follow up comments, that can convey to us what exactly the asker needs in an answer, aside from fulfilling an instructor's arbitrary request to "get an input from a user using javafx then use the input as an array variable in my program."

2
  • 1
    "The entirety of their question is the title and the vague phrase." and code that doesn't compile the intent of which can't be easily determined.
    – VLAZ
    Jul 23, 2019 at 7:16
  • @VLAZ In one of the now deleted comments to the question, the OP had postulated that the question made sense if you don't look at the code, so I was trying to emulate that in my evaluation of the answer. I might go back and edit that to be more clear now that the comment is gone, but I'm not too excited to push this back onto the homepage with another edit.
    – Davy M
    Jul 23, 2019 at 17:52
9

I was one of the close voters, and I have to note that I know JavaFX quite well.

The framework has several controls, among them TextField.

This is a quote from the Javadoc:

Text input component that allows a user to enter a single line of unformatted text. Unlike in previous releases of JavaFX, support for multi-line input is not available as part of the TextField control, however this is the sole-purpose of the TextArea control.

As you can see, a TextField is used for a single line of text. OP seemed to require many lines, so that was the first confusing point.

It didn't help that they didn't include what problem they were trying to solve. An image or a usecase would have been helpful.

In addition to that, their text was talking about assigning values (maybe to the empty TextField to initialize it and get it back later? We can only assume). The code, however, was pretty cryptic: the syntax was incorrect and looked to me to be an attempt to assign values as well, not to get them.

In conclusion: Did OP really need a TextArea? No idea because of missing context/use case. Would a TextField with strings delimited by some character suffice? And: Did they try to assign values or get them?

So, I voted to close to put the question on hold for now.

2
  • 5
    Me: I'll post an answer Close Voter: I'll explain my close vote Me: Well, that's a far more authoritative answer.
    – user10957435
    Jul 22, 2019 at 17:50
  • 2
    @Chipster Yeah I'm getting the same vibe.
    – Davy M
    Jul 22, 2019 at 17:59
7

If nothing else, adding the answer to the question "What about your attempt doesn't work" would be an improvement over, "I tried this and it doesn't work."

Think of it like this - we have no context into why what they were attempting to do didn't work, which would include stack traces or at least a description of the behavior they encountered, so we have no clue what's going on. Hence, "unclear".

5

The big problem here is that the ultimate goal of what the OP is trying to do here is unclear. Sure, they have a snippet to show what they've tried, but that snippet doesn't really help expound the question in the title that the OP "hopes makes sense". If anything, it just adds to the confusion.

Generally, if your title is unclear (which, let's face it, is probably 90% of the time. That's not personal; very few people can get a title correct, even me sometimes.), then you need to expound on it in your question body. No explanation just makes everyone even more confused on what the OP is trying to get answered. This results in bad answers that aren't helpful to the OP, or questions closed as "Unclear what you're asking".

1
  • 4
    Good titles are written by making them the last thing you write. Jul 22, 2019 at 17:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .