private ShotTester() { reload(); build(); setShot(shots.getShotList().get(0)); pnlZone.addMouseMotionListener(this); setSize(600, 600); setDefaultCloseOperation(DISPOSE_ON_CLOSE); }
private void build() { setLayout(new VerticalFlowLayout(3)); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (Shot shot : shots.getShotList()) model.addElement(shot); cboShot = new JComboBox(model); add(cboShot); cboShot.addActionListener(this); add(pnlZone); add(lblLocation); JPanel pnlHolder = new JPanel(new BorderLayout()); pnlBuilder = new BuilderPanel(); pnlHolder.add(lblInfo, BorderLayout.WEST); pnlHolder.add(pnlBuilder, BorderLayout.CENTER); lblInfo.setBorder(BorderFactory.createEtchedBorder()); add(pnlHolder); lblInfo.setPreferredSize(new Dimension(350, 200)); pnlZone.addMouseListener(pnlBuilder); }