Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 24. Pet Store Example


24.1. Pet Store Example

All of the Java code for the Pet Store Example is contained in the file PetStore.java. It defines the following principal classes (in addition to several classes to handle Swing Events):
  • Petstore contains the main() method.
  • PetStoreUI is responsible for creating and displaying the Swing based GUI. It contains several smaller classes, mainly for responding to various GUI events such as mouse button clicks.
  • TableModel holds the table data. It is a JavaBean that extends the Swing class AbstractTableModel.
  • CheckoutCallback allows the GUI to interact with the Rules.
  • Ordershow keeps the items that the customer wishes to buy.
  • Purchase stores details of the order and the products the customer is buying.
  • Product is a JavaBean holding details of the product available for purchase and its price.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat