Doclets javadoc’s output format is determined by a ‘doclet’. The default,standard doclet is built-in to javadoc, and produces the HTML API documentation normally associated with javadoc. If you want to create custom output you can subclass the standard doclet, or you can write your own doclet. For the adventurous, you can create XML or RTF; [...]
Continue reading →
The Structure of a Comment As you will soon see, a single comment can grow to quite a large size. Comments can contain a wide variety of elements,but there are some restrictions to the order in which you can place these elements.To begin, the first line must start with /** (the / must be in [...]
Continue reading →
Testing GUI code can be extremely challenging. By their very nature, GUIs are flexible in their behaviors; even simple GUIs offer billions of possible paths through their features. So how do you test all of these paths? Well, you really can’t, but you can hit the high points, and there are approaches that will help [...]
Continue reading →
Messages and other feedback are the primary ways that you (as the developer) have to respond to the user as she or he is using your application. Use messages to provide warnings when something has gone wrong or might be about to go wrong. Use messages to offer more information about activities that the system [...]
Continue reading →
Menus are a powerful (and necessary) part of almost all GUIs. We focus our attention on the most common implementation of menus, the menu bar. An application’s main menu bar is almost always located at the top of the display—sometimes directly under an application’s title bar, and sometimes separate from the application’s main window and [...]
Continue reading →
Widget Labels are strings of text used to identify other widgets. They aretypically placed to the left or above the widget being labeled.Buttons are rectangular-shaped widgets that are used to initiate actions by the system. A button can be used to initiate either an action command or a navigational command. The nature of the command [...]
Continue reading →
A GUI will always be better if it’s designed with the help of the end-user community.No matter how many businesses you’ve helped to automate, or how many killer GUIs you’ve built in the past, end-user input is essential.Once we’ve got a rough idea what the system’s individual displays ought to look like, it’s time to [...]
Continue reading →
A class should be of the right, you know, granularity. It shouldn’t be too big or too tiny. Rarely is the problem a class that’s too small; however, most not-quite-OO programmers make classes that are too big.A class is supposed to represent a thing that has state and behaviors. Keep asking yourself, as you write [...]
Continue reading →
Don’t use variable names like x and y. What the heck does this mean: int x = 27;27 what? Unless you really think you can lock up job security by making sure nobody can understand your code (and assuming the homicidal maniac who tries won’t find you), then you should make your identifiers as meaningful [...]
Continue reading →
Objects are meant to have both state and behavior; they’re not simply glorified structs. If you need a data structure, use a Collection. There are exceptions to this,however, that might apply to your exam assignment. Sometimes you do need an object whose sole purpose is to carry data from one location to another—usually as a [...]
Continue reading →
The general considerations for programming looks for consistency and appropriateness in your programming style. The following will lists some key points you should keep in mind when writing your perfectly-formatted code. Some of these will be explained in subsequent sections; several of these points are related to OO design,for example, and we cover them in [...]
Continue reading →
The architecture for servlets & JSP uses three layers: (1) the presentation layer,or user interface layer, (2) the business rules layer, and (3) the data access layer. In theory, the programmer tries to keep these layers as separate and independent as possible. In practice, though, these layers are often interrelated and that’s especially true for [...]
Continue reading →
When you use a single PC, you of course need to install all of the required software on that PC. That includes the Java SDK, the web server software, the servlet and JSP engine, and the database management system.In particular, it includes Tomcat, which functions as both a web server and a servlet and JSP [...]
Continue reading →
In contrast to the JSP, the servlet is a Java class that runs on a server and does the processing for the dynamic web pages of a web application. That’s why servlets for a web application are written by web programmers, not web designers.After the processing is done, the servlet returns HTML code to the [...]
Continue reading →
If you’re already familiar with HTML, you can see that most of this JSP consists of HTML code. In fact, the only Java code in this JSP is shaded. That’s why JSPs are relatively easy to write if you know HTML and keep the Java to a minimum. If a JSP requires extensive Java programming, [...]
Continue reading →