Hi Loren,
the embedded version hasn't really been a focus of development, so this could 
probably need some improvments. Feel free to comment on whatever you think 
about it. See my comments below
> I have a desktop Swing application where I am currently using the
> JChemPaintEditorApplet as one of the input/output methods.  I am using CDK
> 1.3.1, but don't currently have the source for JChemPaint.
The source of JCP is in the svn repository at 
https://cdk.svn.sf.net/svnroot/cdk/jchempaint, we recommend using the 3_0 
branch right now.
>
> The method I have used for creating the editor panel is
>
>         final JChemPaintEditorApplet jcp=new JChemPaintEditorApplet();
>         ....
>         add(jcp,constraints);
>         try{jcp.init();}catch (Exception ex){}
>
> this seems to work well enough, but I think all will agree is a bit silly.
I think you should use the JChemPaintPanel(IChemModel chemModel, String gui, 
boolean debug, JChemPaintAbstractApplet applet) constructor. This should save 
you from calling init(). I can't really see what the emtpy constructor is 
for. I will remove this if nobody has an idea what we need it for.
>
> To avoid the exceptions I have tried using:
>         final JChemPaintPanel jcp=new JChemPaintPanel(new ChemModel(),
> "JCP", true);
> but this throws a NullPointerException when I try to run the program.
>
> I guess I don't really understand the structure of the JChemPaintPanel.
The structure of the EditorApplet is like this: JCPEditorApplet contains a 
JChemPaintPanel. This has a BorderLayout and has these components:
- NORTH: A container with menu and InsertTextPanel if switched on
- CENTER: A ScrollPane containing a RenderPanel in center, toolbars in N, S, 
W, E if switched on
> I 
> really like the layout of the Applet, but prefer to use it as part of a
> desktop application.  What is the standard method of including the
> JChemPaintEditorApplet panel in the application?
As I said, there is no standard method right now. Please give the other 
constructor a try.
Stefan

-- 
Stefan Kuhn B. Sc. M. A.
Software Engineer in the Chemoinformatics and Metabolism Team
European Bioinformatics Institute (EBI)
Wellcome Trust Genome Campus
Hinxton, Cambridge CB10 1SD UK
Phone +44 1223 49 2657
Fax +44 (0)1223 494 468

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to