Java JList box alignment code? Does this require setHorizontolAlignment()?
Is there any possible way that I can align a JList box within a panel. To the left side, right side, center side, or bottom side. If so, then how can I implement this?
Can someone give me example coding? And, does this method require you to use the setHorizontalAlignment()? :o
Thank you,
-Nathe
Re: Java JList Alignment Question?
Hey antitru5t,
What type of layout are you using?
You could try:
Code :
Panel myPanel = new Panel();
myPanel.setLayout(new BorderLayout());
myPanel.add(new JList(), BorderLayout().CENTER);