From the act utilitarian perspective, an action is morally right if it maximizes hedonic utility. The hedonic utility of an act, is the difference between the total amount of pleasure and the total measure of pain produced by a particular act; calculating the pleasure and pain for various individuals. Whatever action brings about more pleasure than pain is viewed as morally right. An action maximizes hedonic utility if and only if there is no alternative that produces more hedonic utility than it. Only consequences matter in an act utilitarianism. .
In the case of Joyce Brown, the dilemma was whether or not to impose involuntary treatment on mentally ill homeless people. Judge Lippman had two choices. One is to convict Joyce Brown and give her involuntary treatment, and the other one is to free her. The two aspects he would consider to make a decision are social stability and its relation to will. In terms of social stability, Joyce went to the bathroom in the streets and cursed to any black she met on the street, which posed a threat to the public. If Judge Lippman convicted her and gave her involuntary treatment, the threat to social stability could be avoided. The hedonic utility of convicting Joyce Brown would have a greater balance of pleasure over pain than that of freeing her. .
In regard to the will of Joyce, I'd like to explain it along with social stability. Based on the observation of psychiatrists, Joyce was mentally unstable. Over a period of time, she was unsuited to live on the streets. She neglected to attend to the basic needs such as personal hygiene and appropriate clothing. In addition, she talked to herself and verbally abuse others. Joyce conducted herself in a way that was both harmful to herself and other people. Hence, if Judge Lippman convicted her and gave her involuntary treatment, she would certainly get better with her mental illness and not pose threat to social stability.