hello all,
i am using netbeans ide for development. I want to display a graph on screen. After some search on google i found that we can create a graph by following steps:
1. extending a class with JPanel and overriding its paintcomponent( ) method.
2. now create a panel using palette and open its properties.
3. in property window go to code section and write new derivedclassnam e() in Custom creation code.
This is working very fine. but my problem is that for drawing graph i need certain data(arrays) from my code. using above method i m not able to pass any argument in any new created method because netbeans uses auto generation code like this:
JPanel jp = new derivedclassnam e();
therefore my object is not able to use any new function given in derived class.
An alternative solution which i feel is that writing layout(null) after initComponents( ) statement and then adding my derived panel to particular area on jform. but when i run program using this concept i dont see that graph on screen. it looks like panel is not added to jform.
I have done lot of my coding work on netbeans and cant step back to manual code wrting now for this project. pls help me in solving this problem.
regards
vipin sharma
i am using netbeans ide for development. I want to display a graph on screen. After some search on google i found that we can create a graph by following steps:
1. extending a class with JPanel and overriding its paintcomponent( ) method.
2. now create a panel using palette and open its properties.
3. in property window go to code section and write new derivedclassnam e() in Custom creation code.
This is working very fine. but my problem is that for drawing graph i need certain data(arrays) from my code. using above method i m not able to pass any argument in any new created method because netbeans uses auto generation code like this:
JPanel jp = new derivedclassnam e();
therefore my object is not able to use any new function given in derived class.
An alternative solution which i feel is that writing layout(null) after initComponents( ) statement and then adding my derived panel to particular area on jform. but when i run program using this concept i dont see that graph on screen. it looks like panel is not added to jform.
I have done lot of my coding work on netbeans and cant step back to manual code wrting now for this project. pls help me in solving this problem.
regards
vipin sharma
Comment