Question on instructions for Java

  • Context: Java 
  • Thread starter Thread starter camel-man
  • Start date Start date
  • Tags Tags
    Java
Click For Summary
SUMMARY

The discussion centers on implementing a "Create" event handler in Java for a GUI form that adds three instances of an "Animal" class to a list. Participants clarify that the form is a GUI component and emphasize the need for a defined event handler that executes when the "Create" event is triggered. The ambiguity regarding the existence of the list and its association with the form class is noted, highlighting the necessity for clear specifications in the problem description.

PREREQUISITES
  • Understanding of Java GUI components, specifically Swing or JavaFX
  • Knowledge of event handling in Java, particularly for form events
  • Familiarity with object-oriented programming concepts, including class and instance creation
  • Basic understanding of data structures in Java, such as lists or arrays
NEXT STEPS
  • Research Java Swing event handling, focusing on the ActionListener interface
  • Learn how to create and manipulate lists in Java using ArrayList
  • Explore the implementation of custom classes in Java, specifically creating an "Animal" class
  • Study JavaFX for modern GUI development and event handling techniques
USEFUL FOR

Java developers, software engineers, and students learning GUI programming and event-driven architecture in Java.

camel-man
Messages
76
Reaction score
0
Can someone tell me what they think this is referring to?

On the create event for a form add 3 animal instances to a list.

A form just meaning a GUI? and what does it mean on the create event? Clicking something to add the animals perhaps?
 
Technology news on Phys.org
The information you're providing is pretty sketchy but ...
Apparently there is a procedure for handling a "Create" event - perhaps a "Create Form" event. In that procedures a form object is created. Apparently there is an animal class and a list that can hold animal object or pointers to animal objects. It isn't specified whether the Form includes this list or if the lists exists elsewhere. If the list doesn't already exist, them perhaps you're suppose to add it to either the forum class or to the class of the object that is handling the event.
 
camel-man, there's a lot here that is not clear, such as exactly what a "form" is (i.e., exactly which Java class).

"on the create event for a form" - you need to write a handler for the Create event. When that event is fired, your event handler begins executing

"add 3 animal instances" - you are either given a definition for the animal class, or you have to write it yourself. Either way, in the body of your event handler for the create event, add three instances of the animal class to whatever list you need to be working with.

Hope that helps, but your problem description is pretty vague.
 

Similar threads

Replies
3
Views
4K
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
12K
  • · Replies 18 ·
Replies
18
Views
10K