Setting up a full-fledged GUI application in Java sounds a lot more complicated than it really is. The steps are:
One of the best ways to approach building an Object-Oriented Program (OOP) is to write down the program requirements. Then, identify all the nouns and verbs in the requirements. Each of the nouns suggests an object/class and each of the verbs suggests a function/method.
In particular, the Model-View-Controller (MVC) pattern says there are three major abstract components in software: a Model (which manages the data and the behaviour; as a quick aside, what does that sound like when I talk about something that encapsulates data and their associated behaviours?), a View (which renders the model/displays the information; i.e., the GUI for us), and a Controller (which interacts with the user as well as determining the interaction of the Model and View and telling them to change as needed).
All along, please consider how this would be different from cut-and-paste and starting by simply coding away without any design approach?
If you're having trouble getting started, try setting up a blank lab/program and copying-and-pasting a working sample program (e.g., from the book) and play with it to see exactly what it does and how. Then you can go back and correct the problems your own lab or program might be having once you've worked out the logic and design above.
Here is another great link for the MVC pattern.
instance
and static
methods: there is only a single copy of any method, static or
instance; the only difference is that instance methods are called
with a context that includes an instance (accessible via the this
)
variable. A static method can thus be invoked by using the class
name directly.
Excellent intro to the basics of Java and Object-Oriented Programming: https://www.edureka.co/blog/object-oriented-programming/
Excellent intro to the basics of Java and Object-Oriented Programming: https://medium.com/omarelgabrys-blog/the-story-of-object-oriented-programming-12d1901a1825