}
}
private String saveTC(JComponent jc, String fns) throws Exception{
int result;
JComponentWriter writer;
File file;
JComponentWriterFileFilter filter;
// JFileChooser m_FileChooserPanel = new JFileChooser();
Vector writerNames = GenericObjectEditor.getClassnames(JComponentWriter.class.getName());
Class cls = Class.forName(writerNames.get(0).toString());
writer = (JComponentWriter) cls.newInstance();
// display save dialog
// m_FileChooserPanel.setDialogTitle(getSaveDialogTitle());
// do {
// result = m_FileChooserPanel.showSaveDialog(getComponent());
// if (result != JFileChooser.APPROVE_OPTION)
// return;
// }
// while (m_FileChooserPanel.getSelectedFile() == null);
// save the file
try {
// filter = (JComponentWriterFileFilter) m_FileChooserPanel.getFileFilter();
file = new File(fns);
// writer = filter.getWriter();
if (!file.getAbsolutePath().toLowerCase().endsWith(writer.getExtension().toLowerCase()))
file = new File(file.getAbsolutePath() + writer.getExtension());
writer.setComponent(jc);
writer.setFile(file);
writer.setScale(1, 1);
writer.setUseCustomDimensions(true);
// if (m_CustomDimensionsCheckBox.isSelected()) {
writer.setCustomWidth(300);
writer.setCustomHeight(300);
// }
// writer.setCustomWidth(-1);
// writer.setCustomHeight(-1);
writer.toOutput();
return file.getAbsolutePath();
}
catch (Exception e) {
e.printStackTrace();
return fns;