Problem with "cp.add(workbook);"

3 views
Skip to first unread message

Ibrahim Ben Ahmed

unread,
Aug 30, 2017, 6:54:07 PM8/30/17
to jexcel...@teamdev.com
Hello,

I have tried to use the following Code that I found as in your Webpage :

  • // Simple JWorkbook-based application
  • JFrame frame = new JFrame("Test application");
  • frame.setDefaultCloseOperation (
    • javax.swing.WindowConstants.EXIT_ON_CLOSE
    );
  • Container cp = frame.getContentPane();
  • cp.setLayout( new BorderLayout());
  • JWorkbook workbook = new JWorkbook();
  • cp.add(workbook);
  • frame.setBounds(100100500500 );
  • frame.setVisible(true);
But I get an Error for the following line : 
  • cp.add(workbook);
I am using Eclipse and he suggests to change "JWorkbook" to "Component" and it does not work.
Do you know please how to solve the Problem?

Thank you,

Best Regards,
Ibrahim

Ibrahim Ben Ahmed

unread,
Aug 30, 2017, 7:33:25 PM8/30/17
to jexcel...@teamdev.com
The method add(Component) in the type Container is not applicable for the arguments (JWorkbook).



Thank you,

Best Regards,
Ibrahim

Anna Dolbina

unread,
Aug 31, 2017, 4:57:21 AM8/31/17
to Ibrahim Ben Ahmed, JExcel Forum
Hi,

Could you please try the following sample in your IDE and let us know whether the compilation is successful?

http://jexcel-support.teamdev.com/samples/embedding-jworkbook


Sincerely,
Anna

--
You received this message because you are subscribed to the Google Groups "JExcel Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jexcel-forum+unsubscribe@teamdev.com.
To view this discussion on the web visit https://groups.google.com/a/teamdev.com/d/msgid/jexcel-forum/CAJQNfWonZ2czMDSpWT5BiApCc7j2AyGEOS-iN%2BDj-QfxXDT%3Dng%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages