0

I'm beginner JAVA. I'm using Swing tool for design GUI. I'm looking for GroupBox container similiar in C# winform. Any Help...

Thanks Guys.

Update

JPanel box = new JPanel();  
box.setLayout(new MigLayout("", "[323.00][][27.00][197.00][][][56.00][]", "[][][][][][][][][][][][][][][]"));
box.setBorder(BorderFactory.createTitledBorder("192.168.10.101"));
add(box, "flowx,cell 3 0 1 4");

JLabel lblNewLabel = new JLabel("Start Offset X,Y:");
box.add(lblNewLabel, "flowx,cell 3 0");
4

1 回答 1

4

您可以将 aJPanelBorderFactory.

JPanel box = new JPanel();
box.add(new JLabel("Some element"));

box.setBorder(BorderFactory.createTitledBorder("Box Title"));

您可以将任何其他组件添加到JPanel并根据需要布置它们。边框只是将它们框起来......这是一个更广泛的教程,它还解释了不同的样式。

于 2013-09-13T04:55:42.750 回答