/* * GrafPokus.java * * Created on 7. prosinec 2007, 22:33 */ package cz.frantovo.superPostak; import java.awt.Color; import org.jdesktop.swingx.JXGraph.Plot; /** * * @author fiki */ public class GrafPokus extends javax.swing.JFrame { /** Creates new form GrafPokus */ public GrafPokus() { initComponents(); mujGraf.addPlots(Color.GREEN, new Plot(){ @Override public double compute(double value) { return value * value; } }); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // //GEN-BEGIN:initComponents private void initComponents() { mujGraf = new org.jdesktop.swingx.JXGraph(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout mujGrafLayout = new javax.swing.GroupLayout(mujGraf); mujGraf.setLayout(mujGrafLayout); mujGrafLayout.setHorizontalGroup( mujGrafLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 465, Short.MAX_VALUE) ); mujGrafLayout.setVerticalGroup( mujGrafLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 422, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(mujGraf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(mujGraf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); pack(); }// //GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new GrafPokus().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private org.jdesktop.swingx.JXGraph mujGraf; // End of variables declaration//GEN-END:variables }