import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Curve.java
*
* Created on 15-lug-2010, 17.25.43
*/
/**
*
* @author Paolo
*/
public class Curve
extends javax.
swing.
JFrame {
private Curva c;
/** Creates new form Curve */
public Curve() {
try {
UIManager.
setLookAndFeel(new NimbusLookAndFeel
());
}
initComponents();
c = new Curva(200, 01);
this.add(c);
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1
= new javax.
swing.
JLabel();
jSpinner1 = new javax.swing.JSpinner();
setTitle("Jmetric - by Paolo Ricciuti (C)");
jLabel1.setText("Numero righe");
jSpinner1.setValue(1);
public void stateChanged
(javax.
swing.
event.
ChangeEvent evt
) {
jSpinner1StateChanged(evt);
}
});
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(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
.
addContainerGap(220,
Short.
MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.
addContainerGap(419,
Short.
MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
java.
awt.
Dimension screenSize
= java.
awt.
Toolkit.
getDefaultToolkit().
getScreenSize();
setBounds((screenSize.width-416)/2, (screenSize.height-488)/2, 416, 488);
}// </editor-fold>//GEN-END:initComponents
public boolean isNum
(String str
) {
try {
if (x != 0) {
return true;
} else {
return false;
}
return false;
}
}
private void jSpinner1StateChanged
(javax.
swing.
event.
ChangeEvent evt
) {//GEN-FIRST:event_jSpinner1StateChanged
if ((Integer) this.
jSpinner1.
getValue() != 0
) {
this.
c.
setLinee((Integer) this.
jSpinner1.
getValue());
this.c.repaint();
}
}//GEN-LAST:event_jSpinner1StateChanged
/**
* @param args the command line arguments
*/
public static void main
(String args
[]) {
public void run() {
new Curve().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.
swing.
JLabel jLabel1
;
private javax.swing.JSpinner jSpinner1;
// End of variables declaration//GEN-END:variables
}