newTileset.importTileBitmap("file:
newTileset.importTileBitmap((new File(file)).toURL().toString(),
    public void actionPerformed(ActionEvent event) {        Object source = event.getSource();        if (source == okButton) {            newTileset = new TileSet();            newTileset.setName(tilesetName.getText());            if (tilebmpCheck.isSelected()) {                String file = tilebmpFile.getText();                int spacing = tileSpacing.intValue();                try {                	if(colorButton.getText().equals("None")) {                    	newTileset.importTileBitmap("file://"+file,                            map.getTileWidth(), map.getTileHeight(), spacing,                            tileAutoCheck.isSelected());                	} else {                                                try {	                		Image orig = ImageIO.read(new File(file));	                		Image trans = Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(orig.getSource(),new TransparentImageFilter(colorButton.getBackground().getRGB())));	                		BufferedImage img = new BufferedImage(trans.getWidth(null), trans.getHeight(null), BufferedImage.TYPE_INT_ARGB);	                			                		img.getGraphics().drawImage(trans,0,0,null);	                									newTileset.importTileBitmap(img,								map.getTileWidth(), map.getTileHeight(), spacing,								tileAutoCheck.isSelected());                        }catch(Exception e) {                        }                	}                } catch (Exception e) {                    JOptionPane.showMessageDialog(this,                        e.getMessage(), "Error while importing tileset",                        JOptionPane.ERROR_MESSAGE);                    newTileset = null;                }            }            dispose();        } else if (source == browseButton) {            JFileChooser ch = new JFileChooser();            int ret = ch.showOpenDialog(this);            if (ret == JFileChooser.APPROVE_OPTION) {                tilebmpFile.setText(ch.getSelectedFile().getAbsolutePath());            }        } else if (source == colorButton) {			ImageColorDialog icd;            try {                icd = new ImageColorDialog(ImageIO.read(new File(tilebmpFile.getText())));                Color c = icd.showDialog();                if(c != null) {					colorButton.setBackground(c);					colorButton.setText(Integer.toHexString(colorButton.getBackground().getRGB()).substring(2));                }            } catch (IOException e) {				JOptionPane.showMessageDialog(getOwner(),						"Error while loading image: " + e.getMessage(),						"Error while choosing color",						JOptionPane.ERROR_MESSAGE);            }								} else {            dispose();        }    }