{filelink=3469}
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.util.*;
public class TestSpinner extends JFrame {
public MonthSpinner( ) {
super("Month Spinner");
setSize(200,100);
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container c = getContentPane( );
c.setLayout(new FlowLayout(FlowLayout.LEFT, 4,4));
c.add(new JLabel("Date d'expiration:"));
Date today = new Date( );
JSpinner s = new JSpinner(new SpinnerDateModel(today,
null, null, Calendar.MONTH));
// définir le model de JSpinner
JSpinner.DateEditor de = new JSpinner.DateEditor(s, "dd/MM/yy");
s.setEditor(de);
c.add(s);
c.add(new JTextField("Test JSpinner"));
setVisible(true);
}
public static void main(String args[]) {
new TestSpinner( );
}
}
}
A Voir sur le même Sujet:
- mettre un textfield dans un jspinner
- comment prendre la valeur de jspinner java
- swing date
- exemple d'utilisation de jspinner java
- java jspinner date
- jspinner modification
- jspinner
- jspinner heure format java
- Commet definir un modele pour unJSpinner format pdf
- classe calendar et spinner java