I want to display multiple objects in the north part of a java window. Here is my code:
//Create and add Win and Loss counters.
int winCount=0;
winCounter=new Label("Wins: " + winCount);
this.add(winCounter,"North");
int lossCount=0;
lossCounter=new Label("Losses: " + lossCount);
this.add(lossCounter,"North");
The problem with this code is that it only displays the loss counter. Any help on how to display multiple objects into the North field of a java window?
Nest
winCounterandlossCounterinside another container that provides whatever layout you want for them. Then add that container as the North component.