import javax.swing.*; public class JanelaBox extends JFrame { public JanelaBox() { setTitle("BoxLayout"); setSize(240,120); Box h = Box.createHorizontalBox(); Box v = Box.createVerticalBox(); String[] lista = {"Um", "Dois", "Tres", "Quatro", "Cinco", "Seis", "Sete"}; JList jl = new JList(lista); jl.setFixedCellWidth(70); jl.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); JScrollPane lEsq = new JScrollPane(jl); lEsq.setMinimumSize(new java.awt.Dimension(100,100)); JButton add = new JButton(">>"); JButton clear = new JButton("Clear"); JButton close = new JButton("Close"); JTextArea tDir = new JTextArea(); v.add(add); v.add(clear); v.add(close); h.add(lEsq); h.add(v); h.add(tDir); getContentPane().add(h); } public static void main(String[] args) { JanelaBox jb = new JanelaBox(); jb.setVisible(true); jb.validate(); } }