package com.explodingpixels.macwidgets; import com.explodingpixels.macwidgets.ComponentBottomBar; import com.explodingpixels.macwidgets.MacWidgetFactory; import com.explodingpixels.widgets.PopupButton; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.awt.BorderLayout; import java.util.Arrays; import java.util.List; public class DComponentBottomBarTest { private JFrame frame; @Before public void setUp() throws Exception { } @Test public void doTest() throws Exception { List list = Arrays.asList("Some Item One", "Some Item Two", "Some Item Three", "Some Item Four"); PopupButton popupButton = new PopupButton(list.get(0), list); List list2 = Arrays.asList("Custom...", "400%", "200%", "100%", "75%", "50%", "25%"); PopupButton placard2 = new PopupButton(list2.get(3), list2); JComboBox comboBox = new JComboBox(list2.toArray()); JButton gradientButton = new JButton("Add"); gradientButton.putClientProperty("JButton.buttonType", "gradient"); // JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); ComponentBottomBar componentBottomBar = MacWidgetFactory.createComponentStatusBar(); componentBottomBar.addComponentToLeftWithBorder(popupButton.getComponent()); componentBottomBar.addComponentToLeftWithBorder(placard2.getComponent()); // componentBottomBar.addComponentToLeftWithBorder(gradientButton); // componentBottomBar.addComponentToRight((JComponent) Box.createHorizontalStrut(14)); // componentBottomBar.addComponentToCenterWithBorder(comboBox); frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(componentBottomBar.getComponent(), BorderLayout.SOUTH); frame.setSize(640, 480); frame.setLocationRelativeTo(null); frame.setVisible(true); } @After public void tearDown() throws Exception { frame.dispose(); } }