• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Painting graph and charts with Java.

 
Olena Golub
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,


I read a lot of information that the Swing and AWT components should not be used together. I need to implement in my Java application that is based on SWING the possibility to draw graph and charts. I found that the Java 2D can be used for this. But it�s based on JDK 1.3 and based on the AWT components. And my application work with 1.4.
And my question is, are there are some Java libraries (from SUN), that I can use for drawing 2D graph and charts? Or can I use Java 2D with my Swing components together?

Thanks a lot for your help!
Regards,
Olena.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can certainly combine Swing and AWT components in the same application, but you need to know what you're doing. The main issue is that a Swing component can't be "in front of" most AWT components; so, for example lightweight Swing menus and pop-ups won't be drawn properly on top of a Panel full of Buttons and Choice objects (as opposed to a JPanel filled with JButtons and JComboBoxes, the Swing eqivalent.)

Swing itself is drawn with Java2D. If you have a Java2D-based graph library, it's quite likely that it can be used to draw on a JPanel with little or no modification, anyway.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic