Originally posted by Mike Parish:
This is an interesting problem. Here is the code:
public void createChoiceLayout()
{
titleField = new JLabel("Library Administration");
titleField.setFont(new Font("Library Administration", Font.BOLD, 36));
getContentPane().add(titleField, BorderLayout.CENTER);
}
The problem is that the titleField is never centered! If I substitute "EAST" or "WEST", the title is moved either to the right or left side of the JLabel.
I'm using JBuilder X, and I'm wondering if this is a bug or I just can't code correctly.
Thanks for any suggestion.javascript: x()
javascript: x()
Perhaps this is what you need -
When you add lable to center, it is added at the middle and it occupies entire space if there is nothing on EAST, WEST, NORTH and SOUTH.
HTH,
- Manish