Java Programming: 8 - Using Objects, creating a window

Veröffentlicht am: 03 Juni 2011
auf dem Kanal: CodeMonkeyCharlie
54,419
534

In this tutorial, I demonstrate how to instantiate and use objects by example. We use a JFrame object to create a window, and add a JLabel object to it.

You should probably add: window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // ensures program ends when we close window)

I also mention that Strings are actually objects (as a convenience, Java allows us to instantiate strings by using a string literal, that is, text in quotes).

You can use objects through what is called their interface, in other words, the methods that they make visible to us as users of the object. You can see all of the methods available via Eclipse's code assist feature by typing the object variable name followed by a "." (you can also bring up code assist by pressing ctrl + space).


Auf dieser Seite können Sie das Online-Video Java Programming: 8 - Using Objects, creating a window mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer CodeMonkeyCharlie 03 Juni 2011 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 54,419 Mal angesehen und es wurde von 534 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!