public JPanel addToolbar ( JComponent screen , JComponent toolbar ) { JPanel panelMain = new JPanel ( ) ; panelMain . setOpaque ( false ) ; panelMain . setLayout ( new BoxLayout ( panelMain , BoxLayout . Y_AXIS ) ) ; panelMain . add ( toolbar ) ; toolbar . setAlignmentX ( 0 ) ; panelMain . add ( screen ) ; screen . setAlignmentX ( 0 ) ; return panelMain ; }
Add this toolbar to this panel and return the new main panel .