LibraryMCS usage

User a0ee4512d1

24-04-2006 20:14:16

Hi,





I tried to use java class LibraryMCS. The codes I did are something like:





LibraryMCS mcs = new LibraryMCS();


mcs.clear();








//create a number of molecules from smiles


Molecule mol = MolImporter.importMol(smiles);


mcs.addMolecule(mol);








mcs.search();








JFrame frame = new JFrame();





Container c = frame.getContentPane();


TreePanel panel = mcs.createTreePanel();


c.add(panel);





frame.pack();


frame.setVisible(true);








When I run the above codes, I got a blank frame. So my codes may miss some api calls.





Thanks very much in advance.





Yuhong Wang





wangyuh _at_ mail.nih.gov











pack();





setVisible(true);

ChemAxon efa1591b5a

25-04-2006 16:34:48

Hi,





I'm not a swing wizard, but did you try





frame.setContentPane(tp);





instead of





frame.getContentPane().add( tp );





It should work.


BTW: a new version of LibMCS will soon be available. You may wish to download the alpha release from http://www.chemaxon.com/download.php?dl=&d=/data/download/jchem/test/jchemTEST_2006_04_19.zip





All comments are welcome!





Regards,


Miklos