@Override public void propertyChange(PropertyChangeEvent e) { Object source = e.getSource(); if (source == XIn) { x = ((Number) (XIn.getValue())).intValue(); } else if (source == YIn) { y = ((Number) (YIn.getValue())).intValue(); } else if (source == ZIn) { z = ((Number) (ZIn.getValue())).intValue(); } }
@Override public void actionPerformed(ActionEvent arg0) { x = Integer.parseInt((String) XIn.getValue().toString()); y = Integer.parseInt((String) YIn.getValue().toString()); z = Integer.parseInt((String) ZIn.getValue().toString()); Component c = getParent(); while (c.getParent() != null) { c = c.getParent(); } JFrame pFrame = (JFrame) c; pFrame.setVisible(false); panel.createNewTemplate(x, y, z); }