public WeaponPanel(String name) {
		setSize(new Dimension(585, 300));
		setLayout(null);
		
		try {
			this.sprite = new EditSprite(System.getProperty("resources") + "/sprites/" + name + ".png");
			maxDir = this.sprite.getMaxDir();
			maxFrame = this.sprite.getMaxFrame();
		} catch(Exception e) {
			sprite = null;
		}
		
		panel = new JPanel();
		panel.setBounds(0, 0, 585, 300);
		add(panel);
		panel.setLayout(null);
		
		scrollPane = new JScrollPane();
		scrollPane.setBounds(12, 13, 325, 245);
		panel.add(scrollPane);
		
		spritePanel = new SpritePanel();
		spritePanel.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent e) {
				rectToDraw.setFrame(e.getX(), e.getY(), rectToDraw.width, rectToDraw.height);
			}
			@Override
			public void mouseReleased(MouseEvent e) {
				rectToDraw.setFrameFromDiagonal(rectToDraw.x, rectToDraw.y, e.getX(), e.getY());
				hitboxes[frameComboBox.getSelectedIndex()] = new Rectangle(rectToDraw.x - ((frameComboBox.getSelectedIndex() % maxFrame) * sprite.getSprite().getWidth() / maxFrame), 
						rectToDraw.y - ((frameComboBox.getSelectedIndex() / maxDir) * sprite.getSprite().getHeight() / maxDir), rectToDraw.width, rectToDraw.height);
				spritePanel.repaint();
			}
		});
		spritePanel.addMouseMotionListener(new MouseMotionAdapter() {
			@Override
			public void mouseDragged(MouseEvent e) {
				rectToDraw.setFrameFromDiagonal(rectToDraw.x, rectToDraw.y, e.getX(), e.getY());
				spritePanel.repaint();
			}
		});
		spritePanel.setPreferredSize(new Dimension(322, 242));
		scrollPane.setViewportView(spritePanel);
		
		JLabel label = new JLabel("Swing Time");
		label.setBounds(366, 16, 62, 16);
		panel.add(label);
		
		totalText = new JTextField();
		totalText.setEditable(false);
		totalText.setBounds(440, 13, 116, 22);
		panel.add(totalText);
		totalText.setColumns(10);
		
		timeComboBox = new JComboBox<String>();
		timeComboBox.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				timeSpinner.setValue(swingTimes[timeComboBox.getSelectedIndex()]);
			}
		});
		timeComboBox.setModel(buildSwingBox());
		timeComboBox.setBounds(366, 45, 103, 22);
		panel.add(timeComboBox);
		
		timeSpinner = new JSpinner();
		timeSpinner.addChangeListener(new ChangeListener() {
			public void stateChanged(ChangeEvent arg0) {
				swingTimes[timeComboBox.getSelectedIndex()] = (Float) timeSpinner.getValue();
				float total = 0;
				for(int x = 0; x<swingTimes.length; x++) {
					total += swingTimes[x];
				}
				totalText.setText(total + " seconds");
			}
		});
		timeSpinner.setBounds(481, 47, 75, 20);
		panel.add(timeSpinner);
		timeSpinner.setModel(new SpinnerNumberModel(new Float(0), new Float(0), null, new Float(1)));
		if(swingTimes.length > 0)
			timeSpinner.setValue(swingTimes[0]);
		
		JSeparator separator = new JSeparator();
		separator.setBounds(366, 80, 207, 1);
		panel.add(separator);
		
		JLabel label_1 = new JLabel("Frame Box");
		label_1.setBounds(366, 94, 55, 16);
		panel.add(label_1);
		
		frameComboBox = new JComboBox<String>();
		frameComboBox.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				rectToDraw.setFrame(hitboxes[frameComboBox.getSelectedIndex()].x + ((frameComboBox.getSelectedIndex() % maxFrame) * sprite.getSprite().getWidth() / maxFrame),
						hitboxes[frameComboBox.getSelectedIndex()].y + ((frameComboBox.getSelectedIndex() / maxDir) * sprite.getSprite().getHeight() / maxDir), 
						hitboxes[frameComboBox.getSelectedIndex()].width, hitboxes[frameComboBox.getSelectedIndex()].height);
				spritePanel.repaint();
			}
		});
		frameComboBox.setModel(buildFrameBox());
		frameComboBox.setBounds(366, 123, 103, 22);
		panel.add(frameComboBox);
	}