String command = e.getActionCommand(); if(command.equals("_ul")) { anchor = ANCHOR_UPPERLEFT; } else if(command.equals("_um")) { anchor = ANCHOR_UPPERMID; } else if(command.equals("_ur")) { anchor = ANCHOR_UPPERRIGHT; } else if(command.equals("_mr")) { anchor = ANCHOR_MIDRIGHT; } else if(command.equals("_mm")) { anchor = ANCHOR_MIDMID; } else if(command.equals("_ml")) { anchor = ANCHOR_MIDLEFT; } else if(command.equals("_lr")) { anchor = ANCHOR_LOWERRIGHT; } else if(command.equals("_lm")) { anchor = ANCHOR_LOWERMID; } else if(command.equals("_ll")) { anchor = ANCHOR_LOWERLEFT; } else if(command.equalsIgnoreCase("resize")) {  try { int nwidth = Integer.parseInt(width.getText()); int nheight = Integer.parseInt(height.getText()); int x=0, y=0; switch(anchor) {  } currentMap.resize(nwidth,nheight,x,y); } catch (NumberFormatException nfe) { JOptionPane.showMessageDialog(this,"One of your dimensions is not a number", "Argh!",JOptionPane.ERROR_MESSAGE,null); } dispose(); } else if(command.equalsIgnoreCase("cancel")) { dispose(); } else { System.out.println(command); }  ul.setSelected(anchor == ANCHOR_UPPERLEFT); um.setSelected(anchor == ANCHOR_UPPERMID); ur.setSelected(anchor == ANCHOR_UPPERRIGHT); ml.setSelected(anchor == ANCHOR_MIDLEFT); mm.setSelected(anchor == ANCHOR_MIDMID); mr.setSelected(anchor == ANCHOR_MIDRIGHT); ll.setSelected(anchor == ANCHOR_LOWERLEFT); lm.setSelected(anchor == ANCHOR_LOWERMID); lr.setSelected(anchor == ANCHOR_LOWERRIGHT);
	public void actionPerformed(ActionEvent e) {	}