I've said this a number of times over the last couple of months: what you're feeling is common with beginners who are taught language syntax and program structure but are never given a practical way to relate to these new concepts. You have all these bits and pieces of information being thrown at you and you have very little
context in which to tie them all together to form a clear, bigger picture. In your mind, you have an idea of being able to create some cool programs and apps but you lack the recognition that comes with experience and expertise that more seasoned developers have that allows them to do what you can't right now. It's the same difference between a high school freshman football player and a professional NFL quarterback: the former is still learning the game and probably wouldn't recognize a blitz until he was on his backside while the latter draws on his rich pool of experience to "read" a blitz just by looking at how the opposing team's players are lined up.
Zachary already hinted at part of what you need to do: practice, practice, practice. The other thing is to study, study, study. Targeted study combined with
purposeful practice is something that a number of authors have written about, such as Anders Ericsson in his book
Peak: Secrets from the New Science of Expertise and Malcolm Gladwell, author of
Outliers: The Story of Success, and his
10,000-hour rule. There's even
an article that cites both these authors and some clarifications about Gladwell's rule. So even the experts can't quite agree exactly how one becomes an expert. The common
thread though is practice and study. Of course a little aptitude and talent doesn't hurt. But that can only take you so far. Just ask ex-Cleveland Browns quarterback, Johnny "Mr. Football" Manziel.
One thing that has helped me over the years has been an
understanding of principles. There are many ways you can say the same thing to a computer using a language like Java. However, there are some ways that are better than others. Learn to recognize "good" code and "bad" code. Understanding software design and coding principles helps you see what makes good code good and bad code bad.
Then, learn how to refactor code because unless you're in the top 1% of programming talent, you're going to write bad code. Guaranteed. Then learn how to use automated tests and combine that with refactoring.
Start with the simple principles and refactorings. For principles, familiarize yourself with
SOLID, DRY, SLAP, GRASP. Reading about these will lead you to other related principles and practices. As far as refactoring, there's a whole book about it by Martin Fowler. I recommend learning at least three: Rename, Extract, and
Composed Method.
Finally, and this is what I tell everyone, beginner and experienced alike: Learn how to do
test-driven development. It's probably the most important skill I have learned as a developer that has helped me tie all of the above into one neat bundle of goodness.
Basically, what I'm saying is that software development is as much a craft as it is an engineering discipline and science. The stuff that you're confused about right now has to do with the "engineering and science" side. The things I mentioned above are more about the discipline and craft.
There's a lot of work ahead of you. Good luck.