.jar
file, and include/use resources in an
executable .jar
file.
downloads
directory/folder and then copy it
into the resources
package.
.zip
file
containing all of the code necessary to build your
application. Gradescope will only be checking to ensure that your code
complies with the course style guide. Hence, you may only submit
to Gradescope five times. If you can't get your code to comply with
the course style guide within five submissions, you will receive a
grade of 0 on the assignment.
.jar
file named
TextApplication.jar
(that must NOT contain
any of the classes in multimedia2.jar
). Your code
must be compiled to run under Java 17 (not higher).
Gradescope will assign a maximum grade of 25 (based solely on style). Points will then be awarded manually based on the criteria discussed in the previous paragraph.
JApplication
class so that
we can easily create multimedia applications with an appropriate
lifecycle. Specifically, in a class that
extends JApplication
, the init()
method
will be called when initialization operations should be performed,
the start()
method will be called when the
application might want to start (or re-start) some operations
(e.g., when the window is de-iconofied), and
the stop()
method will be called whenever the
application might want to stop itself (e.g., when the window is
iconified).
Your code should never call these methods. For example, calling the
init()
method yourself will cause a problem if you try and
working with the main window (or its content pane).
about.txt
. You should put this file in the
resources
package, along with the Marker
class
(so that it can be found using a ResourceFinder
)
You should display the String
using
the static showMessageDialog()
method in
the JOptionPane
class.
-source 17
and -target 17
options. In Eclipse, you can accomplish the same thing by setting
the compiler compliance level. See
the Departmental Wiki for help (or search the WWW for the terms
"Eclipse" "java" "compiler" "compliance").
System.out
) in catch
blocks. That's a particularly problematic practice for GUI applications
because they do not have a console.
Instead, you should invoke the showMessageDialog()
method
in the JOptionPane
class, passing it the error messages
you want it to display.
.jar
file and why you might want to do both
at different times.
For help adding the .jar
file containing
the .class
files to an Eclipse project, see the
Departmental Wiki.
TextApplication.mf
)
in TextApplication.jar
that contains something like
the following:
Manifest-Version: 1.2 Main-Class: homebase.TextApplication Class-Path: multimedia2.jar(Note: Manifests must end with a newline character.)
TextApplication.jar
file either from an IDE
or from a terminal/shell.
From the command line, you should use a
command something like the following (from the directory above the
.class
files):
jar -cvfm TextApplication.jar TextApplication.mf gui government homebase realestate resources
Obviously, you should understand all of the arguments before you behave like a lemming.
From Eclipse, you should use a process like the one described on the CS Department's wiki.
TextApplication.jar
and multimedia2.jar
to a directory that contains nothing else
(to make sure that those are the only files being used). You could
otherwise be using .class
files or the .txt
file from the local file system and not know it.
You should then be able to click/double-click (depending on your OS) the
executable .jar
file to run the application. (Of course, you
may first have to associate .jar
files with the appropriate
executable, in this case, java
and/or make the file
executable.)
From the command line, you can execute the application using either
java -jar TextApplication.jar
or java -cp TextApplication.jar homebase.TextApplication
(because the manifest instructs
the interpreter to use multimedia2.jar
).
Depending on how you read in the data files, you may need to include the complete path to the file.
Copyright 2024