//package bodyParts; import java.awt.*; import java.awt.event.*; import javax.swing.UIManager; /** * */ public class BPControl { private BodyPartsGUI _frame = new BodyPartsGUI(); private BPList _leftBPList = new BPList (); private BPList _rightBPList = new BPList (); public BPControl() { _frame.get_pnlBodyPartsLeft().setDrawable (_leftBPList); _frame.get_pnlBodyPartsRight().setDrawable (_rightBPList); _leftBPList.insertFront (new NoosePart ()); _leftBPList.insertFront (new HeadPart ()); // Add controller for left button to move one body part from the left list to the right. _frame.get_jButtonLeft().addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed (ActionEvent e) { // Add code to manipulate _rightBPList and _leftBPList here; _frame.get_pnlBodyPartsLeft().repaint(); _frame.get_pnlBodyPartsRight().repaint(); } }); // Add controller for right button to move on body part from the right list to the left. _frame.get_jButtonRight().addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed (ActionEvent e) { // Add code to manipulate _rightBPList and _leftBPList here; _frame.get_pnlBodyPartsLeft().repaint(); _frame.get_pnlBodyPartsRight().repaint(); } }); _frame.setVisible(true); } public static void main(String[] args) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } new BPControl(); } }