How can I put a horizontal line between vertically ordered elements?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-04-02T15:43:02Z Indexed on 2010/04/02 15:53 UTC
Read the original article Hit count: 257

Filed under:
|
|
|
|

I have a set of vertically ordered elements. They are displayed with the following code:

JPanel myPanel = new JPanel();
myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.Y_AXIS));
JButton button = new JButton("My Button");
JLabel label = new JLabel("My label!!!!!!!!!!!");
myPanel.add(button);
myPanel.add(label);

I would like to put a horizontal line between my elements (something like <hr> in html). Does anybody know how it can be done?

© Stack Overflow or respective owner

Related posts about java

Related posts about swing