Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add jzy3d chart to JFrame without making a new one?
    primarykey
    data
    text
    <p>There is the following code for making jzy3d chart in JFrame:</p> <pre><code>public class SurfaceViewerFrame extends IconFrame { public SurfaceViewerFrame() { setResizable(false); //System.loadLibrary("lib/jogl2-rc10/gluegen-rt.jar"); Settings.getInstance().setHardwareAccelerated(true); FormLayout layout=new FormLayout("10px, 300px, 10px", "30px, 10px, 20px, 300px, 10px"); CellConstraints сс=new CellConstraints(); JLabel title=new JLabel("Выходная поверхность"); Mapper mapper = new Mapper() { public double f(double x, double y) { return x * Math.sin(x * y); } }; // Define range and precision for the function to plot Range range = new Range(-300, 300); int steps = 80; // Create the object to represent the function over the given range. final Shape surface = Builder.buildOrthonormal(new OrthonormalGrid(range, steps, range, steps), mapper); surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1, .5f))); surface.setFaceDisplayed(true); surface.setWireframeDisplayed(false); // Create a chart Chart chart = new Chart(Quality.Advanced, "awt"); chart.getScene().getGraph().add(surface); chart.addController(new CameraKeyController()); // ChartLauncher.openChart(chart, new Rectangle(0, 0, 100, 100), "122"); JPanel panel=new JPanel(); panel.add(title, сс.xy(1, 1)); panel.add((Component)chart.getCanvas(), CC.xy(1, 3)); add(panel); setSize(320, 370); setVisible(true); } } </code></pre> <p>But I see nothing if I don't recomment openChart() method. If I do it, that there will be Chart in my JFrame and a new empty JFrame; I don't want to use it. Please, tell me, how can I fix it? I need to show graphic in my JFrame without making a new one. </p> <p>UPDATE: Sorry, jzy3d is library for making 3d surfaces. And this code works, I don't need other LayoutManager, please, read my question again. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload